html - How to have input field already have the 'clicked on' look without having to click it? -


i want input field have clicked on when @ input field '|' flashing without having having clicked on it?

it gives search field more welcoming touch

here html field:

<input type="text" name="search" size="36" value=""  style="background-color:white;border:  solid 1px #ffffff; height: 30px; font-size:19px; font-family: helveticaneue-light; font-weight: 1; vertical-align:9px;color:#bbb"  onfocus="if(this.value == ''){this.value =  '';this.style.color='#363d42'}" /> 

thanks!

james

if intent have actually focused well, in javascript:

add id input node: id="myid"

<script type="text/javascript">     document.getelementbyid("myid").focus(); </script> 

also, html 5 has autofocus attribute:

<input type="text" autofocus="autofocus" /> 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -