Selecting only within a generated DIV?
I've got a hidden template div that contains an <LI> that is cloned and added to an <UL> on the fly. The cloned <LI> items have placeholder IDs. What I want to do is find all the IDs *within the cloned <LI>* that has a defined string in it (and then replace that string with the proper index, etc.)
So, for example, here's the HTML of the template:
- <DIV id='thisLineRowTemplate' style="display:none">
- <LI class='arrow' id='thisLineTemplateLI'>
- <a href='#ex_EXNUMBER'>
- <DIV class='LABELCLASS thisLine_labelContainer'>
- <TABLE height=100% width=100%>
- <TR valign='center'><TD align='center'>EXLABEL</TD></TR>
- </TABLE>
- </DIV>
- <IMG id='thisLine_checkmark_EXNUMBER' class='thisLine_checkMark_off' src="assets/checkmark.png" width=60px height=54px>
- <DIV id='thisLine_item_EXNUMBER' class='thisLine_exNameContainer'>
- <TABLE height=100% width=100%>
- <TR valign='center'><TD>EXNAME</TD></TR>
- </TABLE>
- </DIV>
- </a>
- </LI>
- </DIV>
...and here's the code so far:
- for(rowIdx=0;rowIdx<theRows.rows.length;rowIdx++) {
- thisRow = $("#thisLineTemplateLI").clone();
- $(thisRow).attr({'id':'thisLineRow_'+rowIdx, 'display':'block'}).appendTo("#theList")
- $(thisRow 'select[id*="EXNUMBER"]').each(function() {console.log("Found a EXNUMBER")});
- };
Line 4 is what's stumping me. The <LI>s are being cloned perfectly. I've tried a couple of different selectors but honestly, I'm still pretty new to jQuery, so some of the concepts continue to elude me. At this point, all I get is "Parse Error" on that line.
All help is appreciated!
Scott.