Here is my jsfiddle example,textarea显示没有值onload,但是onblur,textarea不接受value属性吗?
答案 0 :(得分:5)
<强> Here is the solution :) 强>
因为您使用的是textarea
,所以它的值介于其标记名称之间:
<textarea class="jsf" name="msg" onblur="if(this.value=='') this.value='Write here!';" onfocus="if(this.value=='Write here!') this.value='';">Write here!</textarea>