Javascript examples for jQuery Method and Property:jQuery Method Example
use Javascript to get the value of an element
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.js"></script> <script type="text/javascript"> $(window).load(function(){/* w w w .java 2 s . c om*/ var initialPosition = document.getElementById('arrayPosition').innerHTML; console.log(initialPosition); }); </script> </head> <body> <span id="arrayPosition">4</span> </body> </html>