Archive | November, 2009

jQuery – Get All Divs Whose ID Starts With

Structure: 1 2 3 4 <div id="thisismydiv1"></div> <div id="thisismydiv2"></div> <div id="thisismydiv3"></div> <div id="thisismydiv4"></div> To return an array of all divs that start with ‘thisismydiv’, you would use the following: 1 var divList = $("div[id^=’thisismydiv’]"); The above translates to, find me all divs whose id starts with ‘thisismydiv’. You could now do something cool like add […]

Continue Reading →