How can I make a button to clear just the <textarea>?
How can I make a button to clear just the <textarea>?
It's really simple:
Hope that does it!!Code:<form action="someplace.php" method="POST" name="form"> Name: <input type="text" name="input" id="input" class="input"> Email: <input type="text" name="email" id="email" class="email"> Comment:<textarea name="comment" id="comment" class="comment"></textarea> <input type="button" value="Reset" onclick="document.form.comment.value=''"> </form>
Actually, it's even simpler:Code:<form action="someplace.php" method="post"> <label>Name: <input type="text" name="input" id="input" class="input"></label> <label>Email: <input type="text" name="email" id="email" class="email"></label> <label> Comment:<textarea name="comment" class="comment"></textarea> <input type="button" value="Reset" onclick="this.form.elements['comment'].value=''"> </label> </form>
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Works like a charm. Many thanks!
Bookmarks