Search code examples
htmlhyperlinkhref

Is there another way to link on same page


I have a link which opens a table on the same page if user clicks on the link. What I want to know is that is there another way to link on the same page rather than doing this:

<a href="#" id="showGrid">[Open Grid]</a>

This is because in the url it displays # at the end of the url so I want to know is there another way to link on the same page than href="#".

Thanks


Solution

  • Why even use an <a> tag if you are just binding an event handler to the element. Just use a <span> and style it. You can even give it cursor:pointer if you want that link feel/look