Ask your JavaScript questions! Pay money and get answers fast! (more info)

point everything except the elements ( and .myClass) JavaScript

i have a question :
i use "ouseover" and i want to point all elements but not <p> and not .myClass

something like that :

$(allElements).not('p, .myClass').mouseover();

Answers (2)

2013-02-08

Christianto answers:

Is this working on your site?

jQuery('*').not('p, .myClass').mouseover(function(){
// your function here
});


or you can use on()
jQuery('*').not('p, .myClass').on('mouseover', function(){
// your function here
});


"*" mean select all element [[LINK href="http://api.jquery.com/all-selector/"]]more info here[[/LINK]]

hope this help

2013-02-08

Martin Pham answers:

Please try this example:[[LINK href="http://jsfiddle.net/zTzAc/"]] http://jsfiddle.net/zTzAc/[[/LINK]]