Home  >  Article  >  Web Front-end  >  jquery find tr td example simulation_jquery

jquery find tr td example simulation_jquery

WBOY
WBOYOriginal
2016-05-16 16:49:241034browse

Someone suddenly asked me in the group today why the statement $("#MainContent_GridView1").closest("tr").children("td:eq(1)").text() cannot find the value. I asked him whether to take the text of the td of eq(1) under a tr or all of them. He said everything. . . . Then you must loop through all tr ​​and then find td among them. . .

Here I write a simple blog to help those friends who still don’t know how to use jquery selectors.

I simulated a table for your reference. The following is the html structure

Copy code The code is as follows:





< td>2


;td>22








1 3
33
111 222 333


//I introduced the local jquery file, but I will not introduce it in the article.



Statement:
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