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

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

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

html - jQuery UI Sortable - Remove placeholder after item is dropped -