R
R
RushV2020-10-09 14:16:23
JavaScript
RushV, 2020-10-09 14:16:23

How to implement such output of phone number JS,ModX?

Hello!
How to implement such an output on click to display a phone number?
Placeholder not as I can not withdraw.

let tel = '';
  $('.tel span').text('+7 9XX XXX XX XX').attr('title','Показать номер телефона').on('click',function(){
      $(this).html(tel);
  });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Danny Arty, 2020-10-09
@DanArst

For example. Set the span ID to "Show phone number" and the block where the TV is located.

document.getElementById("show_phone").onclick = function() {show()};
function show() {
  document.getElementById("phone").style.display="block";
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question