PDA

View Full Version : AP or AD Tag Problem


trukaz101
01-26-2009, 12:05 PM
I have a external JavaScript file. Within this file i want to put some code which will let me add text into a AP OR AD Tag on the page from which the JavaScript is executed through a button.

Im trying to create a Quiz which after completed, then requires the user to click a button which check the anwers (done this part) but then shows the participants answers (correct and incorrect), with other text in a Div Tag (Layer?)

Unfortunately im confused...the Tag is called "apDiv1".

I do not know how to reffer to the Div Tag from the script, then i dont know what attribute (property) to use to add text( is it .value, .text, etc?)

Your help would be much appreciated

Thank You

wiilderness
01-27-2009, 07:11 PM
You may wish to check out the following program, which has to be one of the easiest ways to create an online quiz:

http://www.shareware.us/qzscript.htm

It may satisfy your needs.

Hope this helps.

W

trukaz101
01-27-2009, 11:16 PM
Thanks for the link, but i need to learn how to use HTML and Javascript.

nyways i solved the problem:

MY CODE:

document.getElementById("apDiv1").innerHTML = "Your answer is: 12"

YOUR CODE:

document.getElementById("element ID here").innerHTML = "your text here"

EXPLAINED:

document.getElementById("") - used to refer to an element
.innerHTML = "" - property to add value to the element