Hi, I'm a javascript newbie (but html capable). can anyone please help me with this javascript problem?
This is the page.
http://cmpt165.cs.sfu.ca/~jca49/cmpt165/test2.html
If you look at the source code, there is a little bit of javascript in there. Right now, if the "Click Me" button is clicked, it leads a new page with the words "Hello World!".
However, what I want to do is when the button is clicked, the words "Hello World!" should be written to the current document. Specifically, written to the
with id="txt". In other words, I want it so that when a button is clicked, some new text is added to a specific location on the current page.
Is there anyway to do this? So far I don't know if document.write() can achieve this.
Thank you!
2007-03-16
10:56:44
·
3 answers
·
asked by
cherri_pwincesu
1