Manipulating DOMs
The Document Object Model (DOM) is a platform and language neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of documents.
At times, we may want to change the content of a page dynamically. To accomplish this, we will often need to interact with the DOM. Opa provides the module Dom
for the purpose of manipulating the contents of the page currently being displayed by the browser. You can use it to add and remove elements to and from the page, to get the contents of a form, or to apply styles or special effects.
DOM selection
The first step that is necessary, in order to use DOMs, is to select the one that you want to work with. Opa provides many ways of selecting elements. You can find all the available selection functions in the module Dom
. The most commonly used ones are:
Dom.select_id("id") //select element with a given id Dom.select_document() //select the complete document Dom.select_class...