0

In my HTML page i have got a ul class with two li tags , each one pointing to each table as shown below

     <li class='default'><a href="#one">Data</a></li>
     <li><a href="#two">Chart</a></li>


  <table id="one" class="tab-content-1 table table-striped">  
  </table>
  <table id="two" class="tab-content-1 table table-striped">                        
  </table>

When clicked on the li tag the url looks this way

......./index.html#one

OR

......./index.html#two

So now when user presses F5 (reloads the page )

how to remove #one or #two from the URL ??

so that it looks as

......./index.html

http://jsfiddle.net/jq4f69cz/29/

Could you please let me know how to resolve the issue ??

thanks in advance .

Pawan
  • 31,545
  • 102
  • 256
  • 434

1 Answers1

0

Try using data-* attribute to set id of element to show, hide , which should not change location.href to include hash when a element clicked

html

    <li class='default'><a data-href="#one">Data</a></li>
    <li><a data-href="#two">Chart</a></li>

css

li a:hover {
  cursor:pointer;   
}

js

var tabclicked = $(this).find("a").attr("data-href");

jsfiddle http://jsfiddle.net/jq4f69cz/32/

guest271314
  • 1
  • 15
  • 104
  • 177