I`m trying to display default value in textarea,on click it should clear existing data and onblur it should display default text.Following is my code->
<textarea class="TextArea" id="appfield" name="appfield" style="height:44px;" rows="2" onfocus="deletetext(this)" onblur="filltext(this)" value="defaulttext"></textarea>
value is not displaying in textarea.what`s wrong???We have similar case in this website in Title textbox.I have to implement the same in my case. Please suggest an answer.
style="height:44px;" rows="2"and +1 @elias94xxplaceholderattribute. Why not just use that? There are numerous polyfills to make it work in older browsers.m using IE8,placeholder doesnt work. I have to implement the same case as the Title box of this site have.onBlur, onfocus have to do.But the prob is vallue='default text' itself not displaying.placeholderwork in older browsers. As has already been stated, you need to put the value inside the<textarea>tags, and get rid of thevalueattribute.