A tag jumps to the specified div,jquery the implementation method for adding and removing class attributes _jquery

Source: Internet
Author: User

If you use the a tag to jump to the specified div area, you only need to set the href attribute of a label to "#divId", such as:

<a href= "action_1" > Jump to div</a>



<div di= "dction_1" >
  here is the area to be jumped
</div>

Second, add or remove class attributes using jquery

It's also easy to use the jquery Method AddClass () and Removeclass () properties to complete.

Second, the jquery code must be written to

$ (document). Read (function () {
  //code
});

The above is a small set for everyone to bring the a tag jump to specify Div,jquery Add and remove class attributes all the content, I hope we support cloud-Habitat Community ~

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.