概要
hasAttributes は現在の要素が何らかの属性を持つか否かを示す真偽値を返します。
構文
result = targetNode.hasAttributes(attrString);
- result : 真偽値 (
true/false)
例
var t1 = document.getElementById("table-data");
if ( t1.hasAttributes() ) {
// t1 が属性を持つ場合の処理をここに記述
}
| ★ wanayoo — archive 1999 https://developer.mozilla.org/ja/docs/Web/API/Node.hasAttributes | Nouvelle recherche | Portail wanayoo |
Redirected from https://developer.mozilla.org/ja/docs/DOM/Node.hasAttributes
hasAttributes は現在の要素が何らかの属性を持つか否かを示す真偽値を返します。
result = targetNode.hasAttributes(attrString);
true / false)var t1 = document.getElementById("table-data");
if ( t1.hasAttributes() ) {
// t1 が属性を持つ場合の処理をここに記述
}