How do I get a function in the head to turn on or show an image in the body area?
I am a struggling noob, but tutorials will not teach me. If I wanted to document.write, or in this case use an alert box, I would not have a question.
I feel I understand the functions below, but these are not real world examples of anything, at least that I would ever use.
I don’t know how to help myself. But I do know, I need to get the part of alert(“Hello”) changed into something somehow the image will act on, see and display after the 3 second delay.
This is the website I got this code from.
[url]http://www.w3schools.com/js/js_timing.asp
If I can see how to get a function to really do something, would be a big help for me in understanding JS.
This is not a school project, my school doesn’t offer any programming.
I have been at this all day trying to find a tutorial that would help me.
Thanks so much for your help.
<html>
<head>
<script type=”text/javascript”>
function timeMsg()
{
var t=setTimeout(“alertMsg()”,3000);
}
function alertMsg()
{
alert(“Hello”);
}
</script>
</head>
<body”>
<form>
<input type=”button”
value=”show my Image”
onClick=”timeMsg()” />
</form>
<!–
<img src=”myImage.jpg”
width=”100″ height=”100″ /> –>
</body>
</html>