Change Font Size:

DOM What can be done?

Learning process about to begin, I would first several practical examples to see what it can do DOM.

This section notes reference guide:

Change the background pages

Course changes in the following section of the web page background color JavaScript code.

  Function ChangeColor () ( 
Document.body.bgColor = "yellow"
)

In fact, in HTML DOM has been briefed on the inside we made a similar examples of the. Here, we do still more interesting example.

Hide and Show

The button above can control the display and I lost, oh. This effect is through JavaScript with HTML DOM to complete. Code as follows:

JavaScript code:

  <script Type="text/javascript" /> 
Function hide () (
Document.getElementById ( "hiddenTest"). Style.display = "none";
)
Function show () (
Document.getElementById ( "hiddenTest"). Style.display = "block";
)
</ Script>

HTML:

  <form Action="#" /> <button onclick="hide(); return false;" value="Hidden" /> hidden paragraphs </ button> <button onclick = "show (); return false;" value = " " /> show paragraphs </ button> </ form> <p id="hiddenTest" /> the button above can control the display and I lost, oh.  ... </ P> 

  1. DOM What can be done?
  2. The following section: DOM structure

HTML DOM Notes directory

  1. DOM What can be done?
  2. DOM structure
  3. Visit DOM node 1 - getElementById ()
  4. Visit DOM node 2 - getElementsByTagName ()
  5. Part of