Native js and jQuery modify the style name and value of the div attribute at will, and jquery changes it at will

Source: Internet
Author: User

Native js and jQuery modify the style name and value of the div attribute at will, and jquery changes it at will

In some simple examples, you can use native js and jQuery to change and reset the div attributes at will. The Code is as follows:

<! DOCTYPE html> 

Jquery or native js gets a property value in the style.

Document. getElementById (id). style. FILTER

Add an id in the meta statement

The jquery div attribute is set to display: none. js.

If you want to take the value in the div and do not have to hide it $ ("# div"). text (), use this to try ~~ Attr ('value') is equivalent to. val ()

Only useful for controls with value Attributes

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.