I am using jquery 1.3.2.
This is my code:
var additionsPricesItems = debitPrice.find('table[name|=Addition_]');
debitPrice holds the following structure:
<DIV name="DebitPrice"><SELECT name=CustomerSelect><OPTION value=5264>5113575921</OPTION></SELECT><BR><A jQuery1304508596343="43">הסר מחיר חיוב</A>
<TABLE class=PriceBox name="TaskPrice" jQuery1304508596343="45">
<TBODY>
<TR>
<TD class=SubTitle colSpan=2>debit price: </TD></TR>
<TR>
<TD>price: </TD>
<TD><INPUT value=11 type=text name=PriceInput jQuery1304508596343="44"><SELECT class=Small><OPTION selected value="">$</OPTION></SELECT></TD></TR>
<TR>
<TD>by unit: </TD>
<TD><SELECT class=Big name=UnitTypeSelect><OPTION selected value="">none</OPTION><OPTION value=QUANTITY>quantity</OPTION><OPTION value=VOLUME>volume</OPTION><OPTION value=WEIGHT>weight</OPTION></SELECT></TD></TR></TBODY></TABLE>
<TABLE class=PriceBox name="Addition_219" jQuery1304508596343="350">
<TBODY>
<TR>
<TD class=SubTitle colSpan=2>addition price: </TD></TR>
<TR>
<TD>price: </TD>
<TD><INPUT value=12 type=text name=PriceInput jQuery1304508596343="349"><SELECT class=Small><OPTION selected value="">$</OPTION></SELECT></TD></TR>
<TR>
<TD>by unit: </TD>
<TD><SELECT class=Big name=UnitTypeSelect><OPTION value="">none</OPTION><OPTION selected value=QUANTITY>quantity</OPTION></SELECT></TD></TR></TBODY></TABLE></DIV>
for some reason, additionsPricesItems.length equals to zero – jquery doesn;t find any match elements. But there is one element with name prefix of “Addition_”!
You can try to use this:
The
^=is the starts with selector, whereas|=is the contains prefix selector.