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

Popular posts from this blog

rest - Spring boot: Request method 'PUT' not supported -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

symfony - imagine_filter() not generating the correct url in LiipImagineBundle -