I have a working form that generates a string, and by clicking on the button, it places the string in the text area field.
I also have a reset button that allows all fields to be reset, but not a text area with strings.
Here is my code.
HTML:
<form> </tbody> </table> </p> <p> <input value="Generate URL" onclick="createURL1();" type="button"> <input name="result" size="70" class="clearit" type="text" ></input> <input type="button" value="Add The Link" onClick="addtext();"></p> <textarea id="t5" style="width:600px;" name="outputtext" ></textarea><br><br> </p> </td> </tr> </tbody> </table> <input type="reset" value="Clear" id="reset" ></input>
JavaScript:
$(document).ready(function(){ $('#reset').on('click',function(e){ e.preventDefault(); $('.clearit').val(""); }); });
I gave all the inputs that I want to reset for the class (clearit), and the reset button got the identifier: reset. The only field in which I did not want to be reset received a different identifier.
it should work, but it doesnβt .. Please help :)
source share