Wednesday, 21 August 2013

Trying to delete parent node based on innerHTML - Cannot read property 'nodeValue' of undefined

Trying to delete parent node based on innerHTML - Cannot read property
'nodeValue' of undefined

I need to remove the option to delete attachments. The function I tried to
do this with gave me this error: Cannot read property 'nodeValue' of
undefined

I tired doing this:
function hideDelete (){
$("a").filter(function () { return
$.trim(this.childNodes[0].nodeValue) === "Delete";
}).closest("td").hide();
}
HTML:
<td class="ms-propertysheet"><img alt="Delete"
src="/_layouts/images/rect.gif">&nbsp;<a tabindex="1"
href="javascript:RemoveAttachmentFromServer('{2088EB08-E376-4637-A6F9-35675AF46E35}',1)">Delete</a></td>

No comments:

Post a Comment