javascript - Function undefined when run through chrome browser -
i have small project i'm working on, , reason chrome says code below undefined.
html:
<input type="reset" onclick="cleartxt()" class="rset" value="clear text"></input>
javascript:
var cleartxt = function() { document.getelementbyid("text").value = ""; };
can me figure out why functioning way?
your code working fine. here working snippet.
var cleartxt = function() { alert('reset working'); document.getelementbyid("text").value = ""; };
<input type="text" id="text" /> <input type="reset" onclick="cleartxt()" class="rset" value="clear text"/>
Comments
Post a Comment