Change text of link
<p>I have a following HTML</p>

<pre><code>&lt;h2&gt;
    &lt;a href="Controller/Method" onclick="Increment_Visits(10)"&gt;ABC&lt;/a&gt;
&lt;/h2&gt;
&lt;a href="#" id="10"&gt;Visits(10)&lt;/a&gt;
</code></pre>

<p>And following is JS</p>

<pre><code>function Increment_Visits(id) {
    var element = document.getElementById(id);
    var incremented_visits = parseInt(element.innerHTML())++;
    element.innerHTML(incremented_visits);
}
</code></pre>

<p>I want that when user clicks first link i.e. in <code>&lt;h2&gt;</code> tag, then before redirecting to next page, no of visits should be incremented and then redirection to other page. Pls help me, it is not working.</p>
