Pagination change class to "active" with jquery
<p>I have following to create  for pagination:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php  
for($i = 1; $i&lt;=10; $i++){ ?&gt;
     &lt;a class="pagenumber" href="?p=&lt;?php echo $i; ?&gt;"&gt;&lt;?php echo $i; ?&gt;&lt;/a&gt;
&lt;?php } ?&gt;</code></pre>
</div>
</div>
</p>

<p>Now I want change the class <code>pagenumber</code> to "pagenumberselected" if the href from <code>pagenumber</code> includes <code>?p=5</code> from the current page (<code>localhost/myproject/downsite?p=5</code>)</p>