<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