JavaScript text box question..
Author |
Message |
who cares?
|
Posted: Thu Sep 16, 2004 4:50 pm Post subject: JavaScript text box question.. |
|
|
ok, i've done 2 years of Turing so far, but now i started JavaScript at school...
the teacher made us write a program that tells time and refreshes every second....
anyways, can you please tell me of a way to display that "clock" (just text, nothing else) in a text box?
thanks a lot! |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Dan
![](http://wiki.compsci.ca/images/archive/3/3c/20100325043407!Danspic.gif)
|
Posted: Thu Sep 16, 2004 4:53 pm Post subject: (No subject) |
|
|
This is not a fourm for java scripted, this is a forum for the progaming langue java. java scripted != java.
I am moving this to html/webpage section..... |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: Mon Sep 20, 2004 3:54 pm Post subject: (No subject) |
|
|
Create a textbox with HTML and gove it a unique ID. Then simply access that object and set its value property. Something like the following should work, though I haven't tested it.
code: | <html>
<head>
<script type="text/javascript" language="javascript">
function displayTest() {
document.getElementById("test-field").value = "Hello world!";
}
</script>
</head>
<body onload="displayTest();">
<form>
<input type="text" id="test-field"/>
</form>
</body>
</html> |
|
|
|
|
|
![](images/spacer.gif) |
|
|