我們將會來介紹怎麼透過DOM API 操作HTML 上的元素屬性。 Element.hasAttribute(attrName). hasAttribute 方法用來檢查HTML 元素是否有某個屬性。 例子:
確定! 回上一頁