Get the attributes and values of objects using Jquery

Source: Internet
Author: User
1. common method for getting an object $ (*) indicates getting all objects (usually not used) $ (# XXX) 'getting uname]) to get name 1 in the input tag. common Methods for getting objects


$ ("*") Indicates getting all objects (Generally, it is not used.)

$ ("# XXX") 'obtain the Element Object id = XXX (Frequently Used)

$ (". XXX") 'gets the Element Object of class = XXX(Frequently Used)

$ ("P") 'tag selector Selects all p elements(Common)

$ ("Input [name = 'uname']") obtain the element object named name = 'uname' in the input tag.(Common)

For example:

self.find("input[name='complany']").css('border','#FFB240 1px solid');self.find("textarea[name='messcont']").css('border','#FFB240 1px solid');

You can useSpace and greater than sign>, plus sign + and Tilde ~For more information about the usage rules, see (#) here. In this blog post, if you forget to add a comma combination, the following is a case of using a comma combination.

To obtain p whose class is message, the Code is as follows:

Gegrew

Ageaw

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.