Return integer for p element - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:jQuery Method Example

Description

Return integer for p element

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>SO - 21742523</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.10.1.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){/*from  w  w  w  .ja v  a  2 s .co  m*/
var DA1 = parseInt($("#DA1").text(), 10);
console.log(DA1)
    });

      </script> 
   </head> 
   <body>
       h1 class="text-center"&gt; 
      <p id="DA1">34</p>   
   </body>
</html>

Related Tutorials