我需要删除删除附件的选项。我尝试这样做的函数给了我这个错误:无法读取未定义的属性'nodeValue'
我累了这样做:
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"> <a tabindex="1" href="javascript:RemoveAttachmentFromServer('{2088EB08-E376-4637-A6F9-35675AF46E35}',1)">Delete</a></td>
答案 0 :(得分:0)
jQuery的:
$('td a').each(function(){
var $this = $(this);
if($this.text() == 'Delete'){
$this.parent().html('');
}
});