<textarea onfocus=" javascript:clearContents(this); this.cleared=true;" rows="5" cols="40" id="comment" name="comment" <?php if($vis["username"] == $pusername) { echo "DISABLED"; } ?>>...</textarea>
<input onsubmit="if (!this.comment.cleared) clearContents(this.comment); return true;" type="submit" name="Submit" value="Stem!"/>
function clearContents(element) {
element.innerHTML = '';
}
这不会工作,我不知道为什么。它的作用:清除,如果它未得到的onfocus /点击广告的人的内容Javascript onsubmit clearcontent not working