Element インターフェイス
Document
の中にあるすべての要素オブジェクト (すなわち、要素を表現するオブジェクト) が継承する、もっとも一般的な基底クラスです。このインターフェイスは、すべての種類の要素に共通するメソッドとプロパティを記述するだけのものです。
メソッド
代表的なメソッド
メソッド
説明
getAttribute
該当のHTML要素の指定された属性の値を取得します
setAttribute
該当のHTML要素の指定された属性に値を設定します
removeAttribute
該当のHTML要素の指定された属性を削除します
Elementのメソッド
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
プロパティ
代表的なプロパティ
プロパティ
説明
defaultValue
input要素やtextarea要素のvalue属性の初期値を保持するプロパティです
value
input要素やtextarea要素のvalue属性の値を保持するプロパティです
innerHTML
該当のHTML要素の内部のHTMLソースを保持するプロパティです
outerHTML
該当のHTML要素を含むHTMLソースを保持するプロパティです
textContent
該当のHTML要素のテキストを保持するプロパティです
tagName
該当のHTML要素の要素名を保持するプロパティです
childNodes
該当のHTML要素の子ノードの配列を保持するプロパティです
childNodesはテキストや改行が対象となります
children
該当のHTML要素の子ノードの配列を保持するプロパティです
childrenはテキストや改行は対象となりません
Elementのプロパティ
accessKey
attributes
childElementCount
children
classList
className
clientHeight
clientLeft
clientTop
clientWidth
currentStyle
firstElementChild
id
innerHTML
lastElementChild
localName
name
namespaceURI
nextElementSibling
onfullscreenchange
onfullscreenerror
openOrClosedShadowRoot
outerHTML
part
prefix
previousElementSibling
runtimeStyle
scrollHeight
scrollLeft
scrollLeftMax
scrollTop
scrollTopMax
scrollWidth
shadowRoot
slot
tagName
最終更新
役に立ちましたか?