I am trying to make a javascript function work on pressing search button but the function doesnt seem to run. Please guide. Fiddle.
<form action="" method="get" id="searchform" >
<input name="q" type="text" id="search" size="32" maxlength="128" class="txt"/>
<input type="submit" id="hit" value="Search" onclick="myFunction()" class="btn"/>
</form>
Heres the JS,
function myFunction() {
alert("I am an alert box!");
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…