I have a table that has just one row that has columns with class=’99999′.( Other rows have columns with different classes and there is no way I could set an id for a row as this table is generated by display:table ). I am trying to delete the whole row that has columns with class=’99999′. Looks like the part:
$("td.99999").first().parent().remove();
is not working.
Here is the html looks like:
<html>
<head>
<script type="text/javascript" src="/js/jquery-1.3.2/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
alert("I am here");
$("td.99999").first().parent().remove();
});
</script>
</head>
<table border="1">
<tr >
<th>category</th>
<th>rank</th>
<th>priority</th>
<th>contact</th>
<th>price</th>
<th>tax</th>
<th>total price</th>
<th>shipping</th>
<th>Net payment</th>
</tr>
<tr class="displaytagOddRow">
<td class="99999">category 1</td>
<td class="99999">99999</td>
<td class="99999">something</td>
<td class="99999">something</td>
<td class="99999 alignRight">$3,433</td>
<td class="99999 alignRight">$300</td>
<td class="99999 alignRight">$3,733</td>
<td class="99999 alignRight">$349</td>
<td class="99999 alignRight">$4,082</td>
</tr>
<tr class="displaytagOddRow">
<td class="3333">category 2</td>
<td class="3333">3333</td>
<td class="3333">something</td>
<td class="3333">something</td>
<td class="3333 alignRight">$3,433</td>
<td class="3333 alignRight">$300</td>
<td class="3333 alignRight">$3,733</td>
<td class="3333 alignRight">$349</td>
<td class="3333 alignRight">$4,082</td>
</tr>
</table>
</html>
What am I doing wrong?
You have added the reference to the jquery file in the script tag and in the same tag you are writing the code.You will have to put it in another script tag as below:
Keep your below code as
It will work fine…