A Little Interaction: Event, Handlers, and etc (Notes)
- For every event that occurs using your code you can manipulate/handle the event to cause various actions to occur
- To handle events for an object we need a reference for it. This can be done using
document.getElementById("object")
- After making a referece to the object we can modify its properties to commit actions, for example:
object.onclick = myfunction
- We can use
document.createElemement("element")
to create new elements using Javascript. Setting this newly created element to a variable allows us to further manipulate the DOM.
parent.appendChild(var)
appends the var element to the parent element
Media Player: