Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

96
Views
How to target only the number of this with javascript
<span class="woocommerce-Price-amount amount">
  <bdi>
   <span class="woocommerce-Price-currencySymbol">RM</span>
   "678"
  </bdi>
</span>

How can i target only the number of this bdi without the currency simble with Javascript?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Update a child node's textContent. Depending on the currency, the index will be either 1 or 2. In your case it's 2, because the currency symbol is before the amount.

example:

document.querySelector(".woocommerce-Price-amount bdi").childNodes[2].textContent = '1000';

The index 0 is skipped because it is a node with a newline character (thanks @derprischer).

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!