You should be able to do:

$(function()
{
    $("fieldset").find("input,select,textarea,option").focus
        (function()
                {
                       $(this).parents('li').addClass('on');
                }
        )
        .blur
        (function()
                {
                        $(this).parents('li').removeClass('on');
                }
        );

});

On May 24, 9:48 pm, fambizzari <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> Imagine the following HTML scenario:
>
> <li>
>         <label for="title_new">Title</label>
>         <div class="input"><input name="title_new" id="title_new"/></div>
> </li>
> <li>
>         <label for="message_new">Message</label>
>         <div class="input">
>                 <div>
>                         <div>
>                                 <div>
>                                         <input name="message_new" 
> id="message_new"/>
>                                 </div>
>                         </div>
>                 </div>
>         </div>
> </li>
>
> How could i modify the following jquery code so that it effects the
> parent <li> and and not the parent node:
>
> $(function()
> {
>     $("fieldset").find("input,select,textarea,option").focus
>         (function()
>                 {
>                         this.parentNode.className = "on";
>                 }
>         )
>         .blur
>         (function()
>                 {
>                         this.parentNode.className = "";
>                 }
>         );
>
> });
>
> I hope that makes sense.

Reply via email to