简体   繁体   中英

Taking cell values in a table

I want to take some of the cell values in a table. How to take all at a stretch. Can I assign a class name to those cells and take the values for each of them?

Assuming the cells have the class content , you can try by using the default jQuery selector:

var cells = $('td.content');
$.each(cells, function(key, cell) {
    console.debug($(cell).html());
});

That way, the content of each cell having the class content will be written to debug console.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM