Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.3 kB
2
Indexable
Never
 function setPostalCodeVal() {
        const lang = this.state.lang;
        postalCode = decodeURIComponent(postalCode) || 'M1C 1L3';
        const pincodeEle = document.querySelectorAll('.hdca-cms-home-services-banner__wrapper--pincode');

        pincodeEle.forEach(function(item){
          item.textContent = postalCode;
          let aria = item.getAttribute('aria-label');
          if (lang == 'en') {
            aria = `${aria} at ${postalCode}`;
          } else {
            aria = `${aria} at ${postalCode}`;
          }
          item.setAttribute('aria-label', aria);
        });
      }



let price = serviceData ? serviceData.price : '';
            const lang = this.state.lang;
            price = lang == 'en' ? `$${price}` : `${price}$`;
            document.querySelector('.hdca-price').textContent = price;

            const pincodeEle = document.querySelectorAll('.hdca-cms-home-services-banner__wrapper--pincode');

            pincodeEle?.forEach(item => {
              let aria = item.getAttribute('aria-label');
              if (lang == 'en') {
                aria = `${aria} for ${price}`;
              } else {
                aria = `${aria} for ${price}`;
              }
              item.setAttribute('aria-label', aria);
            });