JS can be obtained by turning the object into a DOM when the corresponding DOM is obtained from the tag.

Source: Internet
Author: User

<table id= "Table" >

<TR data = ' {id: ' 1 ', Name: ' Ye '} ' ></tr>

<TR data = ' {id: ' 2 ', Name: ' Yee '} ' ></tr>

<TR data = ' {id: ' 3 ', Name: ' Yeee '} ' ></tr>

</table>

Js:

var dom = $ ("#table"). Find (' tr ');//Get DOM based on TR

At this time dom.attr ("data") can only get the value of one row.

The DOM takes out an array, and if you traverse the DOM's node

for (int i=0;i<dom.length;i++) {

Console.log ($ (dom[i]). attr ("Data"));//The value of the attribute data at this time that is desirable to the current TR

If the dom[].attr ("Data") is written directly, no function error will be reported.

}

JS can be obtained by turning the object into a DOM when the corresponding DOM is obtained from the tag.

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.