onfocus="this.placeholder=''" (Its remove placeholder text)
And
onblur="this.placeholder='User Name'" (Its Add Placeholder text)
Just Add two above code to your input field to clear and add placeholder text.
You can see the Example here:
<input type="text" onblur="this.placeholder='User Name'" onfocus="this.placeholder=''" placeholder="User Name" name="name">
And
<input type="password" onblur="this.placeholder='Password'" onfocus="this.placeholder=''" placeholder="Password" name="name">
To view full html file click the image:
onfocus-onblur learn html css |