Document Object Model
document + | |
---|---|
.getElementById() | Returns the elemnt with the id |
getElementByClassName() | Returns list of all elements belonging to a class |
getElementsByTagName() | Returns list of all elements with the tag |
querySelector() | Returns the first object matching the CSS style selector |
querySelectorAll() | Returns all objects matching the CSS style selelctor |
var myvariable = document.querySelector()
myvariable + | |
---|---|
.textContext | returns just the text |
.innerHTML | returns the actual html |
.getAttribute() | returns the original attribute |
.setAttribute() | set an attribute |
.addEventListner(event,function()) | add listener that execute function() upon specified event |
For more info,
https://developer.mozilla.org/en-US/