Currently, I am attempting to utilize jQuery to set a background image for an HTML element.
<div class="rmz-srchbg">
<input type="text" id="globalsearchstr" name="search" value="" class="rmz-txtbox">
<input type="submit" value=" " id="srchbtn" class="rmz-srchico">
<br style="clear:both;">
</div>
$("#globalsearchstr").focus(function(){
$(this).parent().css("background", "url(/images/r-srchbg_white.png) no-repeat;");
});
Unfortunately, the above code does not seem to work as expected. When the element is focused, the only change that occurs is that a style attribute is added to the HTML, as shown below:
<div class="rmz-srchbg" style="">
</div>
There is no observable change in the CSS.