I have implemented this function (libphonenumber javascript )in a website http://www.phoneformat.com/
How do i get the value returned by this html tag. Whether Yes
In vanilla JavaScript you can use document.getElementById
to get a specific node using ID:
var node = document.getElementById('phone_valid');
And then to get the text from that node you will need to use:
var text = node.innerText || node.textContent;
The jQuery .val()
method is used on form fields like input
, textarea
, select
...