Javascript examples for DOM:Element innerHTML
Get value of HTML element in javascript via innerHTML
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w . ja v a 2s. c om*/ var value = document.getElementById("theInput").innerHTML; console.log(value); } </script> </head> <body> <p id="theInput"> desired-value </p> </body> </html>