What I have is a search bar and an image as the submit button. I want the opacity of the submit button to be 0.5 in its normal state, and 1.0 when the search bar is on :focus.
Here is my HTML:
<form id='searchThis' action='/search' method='get' style='display: inline;'>
<input id='searchBox' name='q' onblur='if(this.value=='')this.value=this.defaultValue;' onfocus='if(this.value==this.defaultValue)this.value='';' style='display:inline;font-family:Segoe UI, Microsoft Tai Le, trebuchet MS,'lucida grande';width: 155px;color:#636363;' type='text' value='Search' vinput=''/>
<input id='submitsearch' alt='Search' height='20px' src='http://1.bp.blogspot.com/-Ab4nALwSEdw/T4LI1pym1LI/AAAAAAAABBA/_oQltx3svas/s320/search.png' style='display:inline; padding-left: 10px; margin-top:1px; position: absolute; opacity:0.5;' title='Search' type='image' width='20px'/>
</form>
But I don’t know whether I should be using CSS or Javascript and I’m not very good at either.
Can anyone help me out?
CSS: