114
rated 0 times
[
118]
[
4]
/ answers: 1 / hits: 19343
/ 11 Years ago, mon, september 2, 2013, 12:00:00
i have a form with an element of type button. I want to use the onclick method to set an image of an img tag, and then simulate the action of the form. I tried the following code:
<html>
<head>
<script type=text/javascript>
function imgtest(){
document.getElementById
(test).src=progress.gif;
}
</script>
<title>Hello</title>
<body>
<form method=POST action=test.php>
<input type=button value=Submit
onclick=imgtest()>
</form>
<div id=img>
<img id=test src=load.png>
</div>
</body>
</html>
Though, this does not seem to work. What may be the other solution?
More From » html