No replies
soap_box
soap_box's picture
Offline
newbie
Last seen: 10 years 47 weeks ago
Joined: 2008-08-26
Posts: 2
Points: 0

Hi, I'm using this code to change the image of my search bar

html:

<input name="" value="" class="search_field" type="text" />
<input name="searchbg" value="" type="hidden" class="searchbg" />

css:

.searchbg
{
background:url(images/search-bar.png) no-repeat;
width:270px;
height:27px;
display:block;
border: 0;
}
 
.search_field:focus + .searchbg
{
background:url(images/search-bar2.png) no-repeat;
}

(ignore the fact that some of the names/values mean nothing Tongue)

which is working fine, changing on click from search-bar to search-bar2. however I need for the image to change again when I click off the search bar. I don't want it to change back, I want it to change to a third image. Is this possible? Can anyone explain how please?

cheers,
sb