html - href must not reload -


i testing following link:

<a href="#">link</a> 

but, expected, reloads current page. how can prevent reloading page, maintaining -a- tag assigned it?

thanks ;)

if don't want behave link, don't use link tag. doing hurt accessibility of page, , don't want that. there other ways of browsing website browser (think screen readers), relies on semantics of page elements. use span if want apply style.

if still want use anchor, can use -

<a href="#" onclick="return false;">link</a> 

this prevent page reloading.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -