I have a table which has links and I'm trying to hide the items from the list that has 404 URLs.
I've made two lists on table below in table. On top it has steve which has link for apple.com, and then there is bill which has invalid src which is just pointing to windows. So on windows it should hide from the list automatically.
Below is sample of my code:
link for fiddle http://jsfiddle.net/vmhnffss/
HTML
<table>
<tbody>
<tr src="https://www.apple.com/" onerror="Error(this);">
<td class="listname">Steve</td>
<td class="listdesc">Apple</td>
</tr>
<tr src="windows" onerror="Error(this);">
<td class="listname">Bill</td>
<td class="listdesc">Windows</td>
</tr>
</tbody>
</table>
JavaScript
function trError(tr) {
tr.style.display = 'none';
}