document.all.box2.innerHTML = s; document.getElementById("box2").innerHTML = s;
<script language="javascript" type="text/javascript"> function putText(s) { alert(s); document.f.box1.value = s; // the two statements have same effect //document.all.box2.innerHTML = s; document.getElementById("box2").innerHTML = s; // can not have this, it does not affect input id but it does affect span id //document.f.submit(); } </script> <body> <% box1 = request("box1") 'box2 = request("box2") if box1 = "" then box1 = "The sky is blue today" end if %> <form name="f" id="f" method="post"> <input name="box1" id="box1" type="text" value="<%=box1%>" /> <br>Box2=<span id="box2"></span> <br> <input type="submit" value="Pink" onClick="putText('Click to Pink Sky')" /> <input name="test" type="submit" value="Dark" /> <% if request("test") = "Dark" then response.Write("<script>putText('Submit to get dark sky')</script>") end if %> </form> </body>
type='submit'
onClick="putText('Click to Pink Sky'); return false;"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)