Attaching a jquery function to some textboxes

Posted by diver-d on Stack Overflow See other posts from Stack Overflow or by diver-d
Published on 2010-06-03T09:22:19Z Indexed on 2010/06/03 9:24 UTC
Read the original article Hit count: 178

Filed under:

I am a newbie to jquery and need a little help. I have created the below function which does what I want it to however when I select a textbox every other textbox are automatically selected. How do I change it and pass a parameter from the textbox so only the selected textboxes css changes on focus and blur?

   <script language="javascript" type="text/javascript">
   $(function () {
       $('.myTextBox').focus(function () {

           $('.box.textbox').addClass("active");
       }).blur(function () {
           $('.box.textbox').removeClass("active");
       });
   });
</script>

© Stack Overflow or respective owner

Related posts about jQuery