Having trouble getting the id of divs on my page that begin with “refresh”.
Example: I have 3 divs on my page.
<div id='refresh5'></div>
<div id='refresh12'></div>
<div id='red'></div>
I’m trying to create a array using javascript of the divs that begin with “refresh”, tried using the following:
var arr = $('div[id^="refresh"]');
alert(arr);
But the alert only shows me [object Object], instead of the div id’s ????
Any help is appreciated.
If you do this for testing purposes, use console.log instead of alert. You can look at all the details ni the javascript log (hit F12 in IE or right click the page and select “Inspect element” in chrome/safari)