javascript - Clicking on an empty anchor link sends the user to the top of the page -


i have 2 empty anchor links <a href="#"> used create tabs. please take @ jsfiddle:

https://jsfiddle.net/mrsnrub/cuuy5cbp/

the problem user goes top of page when going tab tab. use jquery-ui's tabs, have same html element each tab, , think jquery-ui's tabs force have different html elements in each tab.

i want use these tabs further down page, , making user scroll down after every tab switch not user-friendly. how fix this?

update: if click on "tab 1" activate it, shouldn't able hit tab key on keyboard , tab 2 highlighted.

use <a href="javascript:void(0)">.

https://jsfiddle.net/obybyvds/

here's explanation of why works


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -