set jsp element using document.getElementById
<p>How to set jsp variable value from document.getElementById</p>

<p>My HTML element is</p>

<pre><code>&lt;span id="noOfRecPerPage" style="display: none;"&gt;${pulseDetails.noOfRecPerpage}&lt;/span&gt;
</code></pre>

<p>I want to set the value to  like below, but it is not working</p>

<pre><code>&lt;c:set var="noOfRecPerPage" value="${document.getElementById('noOfRecPerPage').innerHTML}"/&gt;

&lt;c:set var="noOfRecPerPage" value="&lt;script&gt;document.getElementById('noOfRecPerPage').innerHTML&lt;/script&gt;"/&gt;

&lt;c:set var="noOfRecPerPage" value="document.getElementById('noOfRecPerPage').innerHTML"/&gt;

&lt;c:set var="noOfRecPerPage" value="&lt;script&gt;document.getElementById('noOfRecPerPage').value&lt;/script&gt;"/&gt;

&lt;c:set var="noOfRecPerPage" value="${document.getElementById('noOfRecPerPage').value}"/&gt;
</code></pre>