Home > Web Front-end > JS Tutorial > body text

How to select blocks and change attribute values ​​​​in jquery_jquery

WBOY
Release: 2016-05-16 17:27:31
Original
917 people have browsed it

jquery changes the value of the class attribute

Copy code The code is as follows:

$("#top_sta" ).removeClass().addClass("top_tab no_current");

1. First find the position of the div and p where the block is located

2. Remove the original class attribute, remove("***") means to remove *** in class, and remove() means to remove all values ​​in class.

Note: remove("") means to remove null characters, that is, no processing will be done to the class.

3.addclass("***"), add the string *** to class
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!