Baseline Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since July 2015.
Element.hasAttribute()
ã¡ã½ããã¯ãæå®ããè¦ç´ ãæå®ãã屿§ãæã¤ãã©ããã示ãè«çå¤ãè¿ãã¾ãã
js
hasAttribute(name)
弿°
name
屿§ã®ååã示ãæååã§ãã
è«çå¤ã§ãã
ä¾js
const foo = document.getElementById("foo");
if (foo.hasAttribute("bar")) {
// do something
}
仿§æ¸ Specification DOM RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4