I am trying to run a selector that has a large number of element ids to match but in IE8 i keep getting the error: object doesnt support this property or method.
The jquery is like this:
var elements = $('#182,#183,#184,#185,#211,#212,#213,#214,#220,#221,
#222,#223,#225,#226,#227,#228,#234,#241,#242,#243,#244,
#245,#246,#247,#248,#250,#251,#252,#253,#256,#257,#258,#259,#260');
The actual query is actually longer and the ids are not sequential.
I have broken up the list into smaller parts and run each part separately.
All of the smaller selectors run fine.
I was wondering if there is a way i could use one selector?
As Requested here is an example of the markup but there is hundreds of rows in reality:
<table id="ListTable">
<tbody>
<tr id="1" style="display: none;"></tr>
<tr id="2" style="display: none;"></tr>
<tr id="3" style="display: none;"></tr>
<tr id="4" style="display: none;"></tr>
<tr id="95" style="display: none;"></tr>
<tr id="5" style="display: none;"></tr>
<tr id="6" style="display: none;"></tr>
<tr id="7" style="display: none;"></tr>
<tr id="8" style="display: none;"></tr>
<tr id="9" style="display: none;"></tr>
<tr id="10" style="display: none;"></tr>
<tr id="11" style="display: none;"></tr>
<tr id="82" style="display: none;"></tr>
<tr id="83" style="display: none;"></tr>
<tr id="84" style="display: none;"></tr>
<tbody>
</table>
put a class on each of those elements with ids(btw don’t use ids with just numbers. make them a bit more descriptive and just parse them with substring) and call that class instead so you’ll get an array of those elements:
say you wanted to select:
you can then select them all using:
then if you wanted to get their ids loop through example and then do a substring
*note, you better check the documentation for each, im not actually sure that’s the syntax