0

I have a HTML code:

<a class="show_dropdown_make_call" href="/">380502543445</a>
<a class="show_dropdown_make_call" href="/">380502543890</a>
<a class="show_dropdown_make_call" href="/">380507893445</a>
<a class="show_dropdown_make_call" href="/">380563443445</a>
<a class="show_dropdown_make_call" href="/">380508763445</a>

How to make “Call” instead of phone numbers?

Tried it like this but nothing works.

document.getElementsByClassName('show_dropdown_make_call').innerHTML = 'To call';
  • 1
    `getElementsByClassName` doesn't return one element. – evolutionxbox May 14 '21 at 22:50
  • 1
    Does this answer your question? [What do querySelectorAll and getElementsBy\* methods return?](https://stackoverflow.com/questions/10693845/what-do-queryselectorall-and-getelementsby-methods-return) – evolutionxbox May 14 '21 at 22:50

1 Answers1

-2

document.querySelectorAll('.show_dropdown_make_call').forEach(
  x => x.innerText = 'Call'
)
<a class="show_dropdown_make_call" href="/">380502543445</a>
<a class="show_dropdown_make_call" href="/">380502543890</a>
<a class="show_dropdown_make_call" href="/">380507893445</a>
<a class="show_dropdown_make_call" href="/">380563443445</a>
<a class="show_dropdown_make_call" href="/">380508763445</a>
bel3atar
  • 913
  • 4
  • 6