textarea onclick 删除文本
问题描述:
我知道如何在简单的 html 文本框中删除文本,但 html 文本区域似乎要复杂得多.而不是将文本放在中间的 value 属性:
I know how to remove text in a simple html textbox but html textareas seem much more complicated. instead of the value attribute you put the text right between:
<html>
<textarea> </textarea>.
</html>
这就是我在制作 onFocus 和 onBlur 事件时遇到问题的原因.
This is why im having trouble making an onFocus and onBlur event.
答
<textarea name="message" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;">
Put anything for default value here
</textarea>