Solution 1 is perfect solution for your Question..
Also you can use
blur instead of
focusout... See example below..
<script type="text/javascript">
$(document).ready(function()
{
$('.txtbox_focus').focus(function()
{
$(this).css("background-color","#cccccc");
});
$('.txtbox_focus').blur(function()
{
$(this).css("background-color","#ffffff");
});
});
</script>
html below..
<asp:textbox id="TextBox1" runat="server" class="txtbox_focus" xmlns:asp="#unknown"></asp:textbox>
Hope it helps you...