javascript - Loop Elements in JQuery -


i trying run loop on few elements in jquery. before says it, not need .each(). trying run through elements genuine loop- once successful iteration runs, loop break , prevent same action being done on other elements. looked briefly @ straight javascript version, .getelement... methods, understanding won't satisfy other requirement- list of elements iterated on created via partial-string jquery identifier:

rows = $('tr[id^="am_assetrow_' + parentasset.replace(/ /, "_") + '_' + type + '"]'); 

does know of might me working?

edit: bit more information on application: checking see if value can inserted existing row of table, , if not, creating new row , inserting there. thus, need loop exit if suitable fit found, , after loop terminates, need know whether terminated in success (placing value) or failure (no available locations- time create new row).

in jquery, if want $.each() loop end immediately, return false function call.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -