javascript - Placeholder appearing only after click HTML JS -


i have simple form. when page loads, input fields empty, , placeholder appears when click on field.

<input type="text" onblur="if(this.value=='') this.value='vorname,    name';"     onfocus="if(this.value=='vorname, name')      this.value='';"         name="dynamic_0" title="vorname, name" value=""> 

how can placeholder visible on page load well?

use html placeholder element

<input type="text" placeholder="whatever want" onblur="if(this.value=='') this.value='vorname, name';"     onfocus="if(this.value=='vorname, name') this.value='';"         name="dynamic_0" title="vorname, name" value="">

for old ie compatibility should check out polyfill aswell: https://github.com/ginader/html5-placeholder-polyfill


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -