概要
hasAttributes
は現在の要素が何らかの属性を持つか否かを示す真偽値を返します。
構文
result = targetNode.hasAttributes(attrString);
- result : 真偽値 (
true
/false
)
例
var t1 = document.getElementById("table-data"); if ( t1.hasAttributes() ) { // t1 が属性を持つ場合の処理をここに記述 }
hasAttributes
は現在の要素が何らかの属性を持つか否かを示す真偽値を返します。
result = targetNode.hasAttributes(attrString);
true
/ false
)var t1 = document.getElementById("table-data"); if ( t1.hasAttributes() ) { // t1 が属性を持つ場合の処理をここに記述 }
Element
accessKey
attributes
childElementCount
children
classList
className
clientHeight
clientLeft
clientTop
clientWidth
currentStyle
[翻訳する]firstElementChild
[翻訳する]id
innerHTML
lastElementChild
[翻訳する]localName
name
namespaceURI
[翻訳する]nextElementSibling
[翻訳する]onfullscreenchange
[翻訳する]onfullscreenerror
[翻訳する]openOrClosedShadowRoot
[翻訳する]outerHTML
prefix
previousElementSibling
[翻訳する]runtimeStyle
[翻訳する]scrollHeight
[翻訳する]scrollLeft
[翻訳する]scrollLeftMax
[翻訳する]scrollTop
scrollTopMax
[翻訳する]scrollWidth
shadowRoot
slot
tabStop
[翻訳する]tagName
after()
[翻訳する]animate()
append()
attachShadow()
before()
[翻訳する]closest()
computedStyleMap()
[翻訳する]createShadowRoot()
[翻訳する]getAnimations()
[翻訳する]getAttribute
getAttributeNames()
getAttributeNode
getAttributeNodeNS
getAttributeNS
getBoundingClientRect()
getClientRects
getElementsByClassName()
getElementsByTagName
getElementsByTagNameNS
hasAttribute
hasAttributeNS
hasAttributes
hasPointerCapture()
insertAdjacentElement()
[翻訳する]insertAdjacentHTML
insertAdjacentText()
matches()
msZoomTo()
[翻訳する]prepend()
querySelector()
querySelector()
[翻訳する]querySelectorAll()
[翻訳する]querySelectorAll
releasePointerCapture()
remove()
removeAttribute
removeAttributeNode
removeAttributeNS
replaceWith()
[翻訳する]requestFullscreen()
requestPointerLock()
[翻訳する]scroll()
[翻訳する]scrollBy()
[翻訳する]scrollIntoView()
scrollIntoViewIfNeeded()
[翻訳する]scrollTo()
[翻訳する]setAttribute
setAttributeNode
setAttributeNodeNS
setAttributeNS
setCapture()
setPointerCapture()
toggleAttribute()
[翻訳する]afterscriptexecute
[翻訳する]auxclick
[翻訳する]blur
click
compositionend
compositionstart
[翻訳する]compositionupdate
[翻訳する]contextmenu
[翻訳する]copy
cut
dblclick
DOMMouseScroll
[翻訳する]error
focus
focusin
focusout
gesturechange
[翻訳する]gestureend
[翻訳する]gesturestart
[翻訳する]keydown
[翻訳する]mousedown
mouseenter
mousemove
[翻訳する]mouseout
[翻訳する]mouseover
[翻訳する]mouseup
[翻訳する]mousewheel
[翻訳する]MozMousePixelScroll
[翻訳する]msContentZoom
[翻訳する]MSGestureChange
[翻訳する]MSGestureEnd
[翻訳する]MSGestureHold
[翻訳する]MSGestureStart
[翻訳する]MSGestureTap
[翻訳する]MSInertiaStart
[翻訳する]MSManipulationStateChanged
[翻訳する]overflow
[翻訳する]paste
select
[翻訳する]show
[翻訳する]touchcancel
touchstart
underflow
[翻訳する]webkitmouseforcechanged
[翻訳する]webkitmouseforcedown
[翻訳する]webkitmouseforceup
[翻訳する]webkitmouseforcewillbegin
[翻訳する]wheel
[翻訳する]