Dynamic HTML(DHTML)

  • Using Javascript we could be able to generate the complete HTML page with all dynamic data as and when required.

It provides predefined methods and objects using which we could be able to read, write or form on the HTML input elements.

 document.getElementById(): 

Using which we could refer to a DOM Element on page using its unique ID.

document.getElementByClassName():

Using which we could refer to a DOM Element on page using its name.

 document.getElementByTagName():

Using which we could refer to a DOM Element on page using its tag name.

document.querySelector():

Syntax: document.querySelector(#id / .class / tagName);

document.createElement('div'):

Using which we could be able to create any DOM Element using JavaScript. 

Element.style:

Using which dynamically any CSS Property of any DOM Element can be retrieved or updated.

Ex: spanTag.style.border = '1px solid green';

spanTag.style.background = bgColor;

Tagged:
Sign In or Register to comment.