Articals
DHTML
DHTML, Dynamic Hyper Text Language, is using a combination of HTML, CSS and JavaScript to create interactive, customized and professional looking websites. DHTML is not an actual I computer language itself but a skill of combing the three other major languages together
Create DHTML you need a good understanding of HTMLK a understanding of JavaScript and CSS. However you do know how to create full programs in JavaScript but create small snippets that change HTML code and css when requires and the f basic way a of calling
To make DHTML interactive you must first create the basic page in HTML and the basic style sheet. You then create functions that are placed in the head section of the document. Then you go back ~ section to the HTML code and add in attributes to the code that will call up the functions that will make the webpage interactive. You x can also use the :hover selectors in css to make the styles change when the mouse is placed over certain parts of the webpage
To create functions that change part of a html document when called you use the following format: function name()
(
document.getelement byID(ELEMENTS ID).innerHTML="NEW HTML"
) -
In the above example you place the name of the element, its id, in the brackets between "I' MARKS and the knew html in new html . This new HTML will replace the old one not must add to it. You can also change CSS styles by using JavaScript, this can be useful as you can use CSS to hide certain parts of a webpage or you can use it to change the colour of things depending on what the user chooses. To do this you use a function following the below pattern
function name
(
document.getelementById(ELEMENT ID).CSS property="NEW CSS PROPETY" -
)
This will change the element in the brackets css property that is stated in the section after the brackets to the value that is written in the quotation marks.
These could be used to create content when a button is presented by using the first function or to hide content when the second one is used by sitting display to R none There are lots of different attributes that you can set on a HTML element that will cause a JavaScript function. The main on e that you can use is onclick, after this you put the javeascript that you want to happen, this is normally a function that you ha v -e declared in the head sedtion of the document. An example is given below:
A onclick="NAME()"
bravenet.com