刪除屬性

要從元素中刪除屬性,可以使用函式 .removeAttr(attributeName) 。例如:

$('#home').removeAttr('title');

這將從 ID 為 home 的元素中刪除 title 屬性。