문제

I am having some difficulty with a form field where it is only the textarea field causing the issue that the value appears after I click into the textarea and not already appearing like the input fields:

<textarea name="enquiry" id="enquiry" onfocus="if(this.value == 'Enquiry') this.value='';" onblur="this.value=!this.value?'Enquiry':this.value;" value="Enquiry"></textarea>
도움이 되었습니까?

해결책

Try this,

<textarea name="enquiry" id="enquiry" onfocus="if(this.value == 'Enquiry') this.value='';" onblur="this.value=!this.value?'Enquiry':this.value;">Enquiry</textarea>

Just remove the value attribute and put the text inside <textarea></textarea>

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top