Javascript examples for DOM HTML Element:Input Button
Input Button value Property - Get the text displayed on a button:
<!DOCTYPE html> <html> <body> Favorite car:/*from w ww.j a va 2 s . com*/ <input type="button" id="myBtn" value="Volvo"> <button onclick="myFunction()">Test</button> <script> function myFunction() { var v = document.getElementById("myBtn").value; console.log(v); } </script> </body> </html>