Javascript examples for DOM HTML Element:Div
Output value from div
<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 2 s . c om var x = document.getElementsByClassName("price-txt")[0].innerHTML; document.getElementById("demo").innerHTML = parseInt(x); } </script> </head> <body> <div class="price-txt"> 145 GAR </div> <p id="demo"></p> </body> </html>