<table id ='t1'> <tr val='1'></tr> <tr val='2'></tr> <tr val='3'></tr> <tr val='4'></tr> <table>
how to get from this array = 1,2,3,4
You can use .map(), for example:
.map()
var arr = $("#t1 tr").map(function() { return $(this).attr("val"); }).get();
You can check it out here .
This should work:
$.map( $( "table#t1 tr"), function( item) { return $(item).attr("val");})
Source: https://habr.com/ru/post/1781433/More articles:ANTLR Tree Grammar and StringTemplate Code Translation - stringtemplatePHP Tonic Services - using the same verb more than once in a single service - restHow to unit test WIX to combine modules? - unit-testingHow to get binary data in Django! - pythonOracle jdbc driver: implicit statement cache or setPoolable (true)? - javaDetails View and integrate with TinyMCE <% @Page validateRequest = "false"%> - c #How to configure catch-all in an Exchange2010 hub environment? - exchange-server-2010ะงัะพ ัะฐะบะพะต Static Constructor ะฒ ะก#? - c#Convert php to java / android arrays - javaAPI Document Creation Tool - ruby โโ| fooobar.comAll Articles