title: How to do I persists selected value of <li> tag on page refresh through jQuery
body: <p>How Do I maintain the selected value of the ul>li in the below code
  HTML Code</p>
  
  <pre><code>&lt;ul class="paginationSize"&gt;
   &lt;li&gt;SHOW:&lt;/li&gt;
   &lt;li id="paginationClass" data-paginationValue="20" class=""&gt;&lt;a href="#"&gt;20&lt;/a&gt;
   &lt;/li&gt;
   &lt;li id="paginationClass" data-paginationValue="40" class=""&gt;&lt;a href="#"&gt;40&lt;/a&gt;
   &lt;/li&gt;
   &lt;li id="paginationClass" data-paginationValue="60" class=""&gt;&lt;a href="#"&gt;60&lt;/a&gt;
   &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>jQuery Related to the PHP CODE</p>
  
  <pre><code>$(".paginationSize li").click(function(){
          $(".active").removeClass("active");
          $(this).addClass("active");
          paginationSize =  $(this).attr("data-paginationValue");
          setGetParameter('pageSize',paginationSize);
      });
  </code></pre>
  
  <p>setGetParameter Function</p>
  
  <pre><code>function setGetParameter(paramName, paramValue)
  {
      var url = window.location.href;
      var hash = location.hash;
      url = url.replace(hash, '');
      if (url.indexOf(paramName + "=") &gt;= 0)
      {
          var prefix = url.substring(0, url.indexOf(paramName));
          var suffix = url.substring(url.indexOf(paramName));
          suffix = suffix.substring(suffix.indexOf("=") + 1);
          suffix = (suffix.indexOf("&amp;") &gt;= 0) ? suffix.substring(suffix.indexOf("&amp;")) : "";
          url = prefix + paramName + "=" + paramValue + suffix;
      }
      else
      {
      if (url.indexOf("?") &lt; 0)
          url += "?" + paramName + "=" + paramValue;
      else
          url += "&amp;" + paramName + "=" + paramValue;
      }
      console.log(url);
      window.location.href = url + hash;
  }
  </code></pre>
  
  <p>I want to maintain the active class on selected option (i.e. If I select option 40 then after page refresh option 40 should be selected and default I have to set active on value 20)</p>
  
  <p>Thanks in Advance</p>