jquery - Input box does not show default value -
i have email box in show default value "enter email"
herefore created email box in html:
<p> email: <br /> <input type="email" size="30"/> </p>
an following jquery:
$(document).ready(function(){ var default = "please enter email adress; $("input").attr("value", default); });
it not show however. suggestions i'm doing wrong?
why doing this, can directly use placeholder
attribute.
there no need of using jquery or javascript
<p> email: <br /> <input type="email" size="30" placeholder="please enter email address"/> </p>
Comments
Post a Comment