I need all the elements of the 开发者_Go百科cells using jQuery.
Let us assume I have three columns and if I give second column index then response should be only from second column.
Thanks in advance
Use this:
$("#table1").find("tr td:nth-child(3)")
This will give you all the td
elements from the 3rd column (change the '3' for your value)
Cheers
Loop through each row and push the .text()
from the td at the index you are looking for into an array.
See http://jsfiddle.net/derekddecker/YWX9F/
精彩评论