Issue
Here is My code
<form name="formA">
<input type="text" name="iptA" id="iptA" value="" />
<input type="button" name="btnA" id="btnA" value="Click Here" onclick="count();"/>
<input type="button" name="btnClr" id="btnClr" value="Clear" onclick="clear();"/>
</form>
<script type="text/javascript" charset="utf-8">
var a = 0;
document.formA.iptA.value = a;
function count(){
a++;
document.formA.iptA.value = a;
}
function clear(){
a = 0;
document.formA.iptA.value = a;
}
</script>
In this, the function count()
is working properly but the second function clear()
is not working.
Thanks in advance 😊
Solution
Rename clear
to foo
and it will work. clear
already has a meaning in browser pov - clearing the console
Answered By - Royi Namir Answer Checked By - Mildred Charles (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.