This probably will work too. $("input:not(#addNewAddress, #addNewContactDetail)").click();
On Dec 15, 3:01 pm, "Rik Lomas" <lomas....@gmail.com> wrote: > Try: > > $("input").not('#addNewAddress, #addNewContactDetail').click(); > > Rik > > 2008/12/15 WhoButSB <whobu...@gmail.com>: > > > > > > > Hello All! > > I'm trying to figure out the correct way to use the not() method. I > > know there is also a :not() filter in selectors class but I couldn't > > get that one to work either. > > > My goal is to add a click function to all the input fields on a page. > > But not select the input buttons that are nested in certain divs. > > > Here is what I have tried so far: > > > $("input").not($('#addNewAddress:input', > > '#addNewContactDetail:input')).click(function(){ > > console.log($(this).attr('id')); > > }); > > > AND > > > $("input").not('#addNewAddress input', '#addNewContactDetail > > input').click(function(){ > > console.log($(this).attr('id')); > > }); > > > Neither have worked so far. Should I be using the :not() command in > > the selector? > > > Thanks for the help! > > -- > Rik Lomashttp://rikrikrik.com