Javascript examples for DOM HTML Element:Input Number
Input Number placeholder Property - Display the placeholder text of a number field
<!DOCTYPE html> <html> <body> <input type="number" id="myNumber" placeholder="Favorite Number"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w w w . j a v a 2 s . com var x = document.getElementById("myNumber").placeholder; document.getElementById("demo").innerHTML = x; } </script> </body> </html>