The jump problem of a label in HTML __html

Source: Internet
Author: User
One, what is a label

A label is one of the basic tags in HTML that defines a hyperlink to link to another page from one page. two, the href attribute

1, can link to the object of the document, can also link to the URL on the Web site;

<a href= "/index.html" > links to a page in this site </a>

<a href= "http://www.baidu.com/" > links to pages on the World Wide Web </a>

2, a label can use the text can also use the picture;

<a href= "/index.html" ></a>

<a href= "/index.html" > Text </a>

3, linked to the same page in different locations;

<a href= "#ID" > #ID是要跳转到位置标签的id </a>

Third, other properties

1, download: Downloaded hyperlink target. <a href= "/downloaded pictures. gif" download= "Download Pictures" > This is the download link </a>;

2. Target: The link is opened by: There are five options:

_blank: Opens the linked document in a new window.
_self: Default. Open the linked document in the same frame.
_parent: Opens the linked document in the parent frameset.
_top: Opens the linked document throughout the window.
FrameName: Opens the linked document in the specified frame.

Four: JS to achieve a label jump; do not use the HREF attribute to implement

1. With Parameter form

1) <a onclick= "test (Parameter ...);" >test</a>

2 Script code:

<script>
function test (obj) {
"Executed Code"
}
</script> 2 with no parameters

1) <a onclick= "test ();" >test</a>

2 Script code:

<script>

function Test () {

"Executed Code"
}
</script>











Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.