In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how the a tag in html uses the href attribute and the onclick event, I believe most people don't know much about it, so share this article for your reference. I hope you will get a lot after reading this article. Let's learn about it together.
The a tag is mainly used to jump pages, either through the href attribute or in the onclick event.
PHP Chinese website
This code is fine in mainstream browsers, but it can't jump in IE6. What is the reason for this?
_ javascript:void (0)
Void (arg); can be understood as a function that always returns null, but its arguments cannot be empty. Its parameters can be arbitrary expressions or even functions.
test
IE6 first runs events bound by DOM itself, such as onclick;, which executes the href property sequentially if it does not prevent bubbling. While void (0); does not need to execute any event, IE6 tells the browser not to perform any event (overwriting the previous action), and ending bubbling is equivalent to returnfalse;, so the browser does not perform any action. So all you have to do is to stop bubbling within the onclick event.
PHP Chinese website
In this way, it can work properly under IE6.
Another way is not to use _ javascript:void (0); you can avoid using # instead. The # in the href attribute originally means anchor # name, so it goes to the top of the page when no anchor is specified. # has a specific meaning. The default is # top. If the content after # is considered to be a tag and jumps there from the page to find the corresponding tag, it will jump to the top of the page. If you do not want to jump, you can use #, # is a meaningless tag assignment.
The above is all the content of the article "how the a tag in html uses href attributes and onclick events". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.