Reputation: 965
I am using a jquery context menu plugin (http://www.trendskitchens.co.nz/jquery/contextmenu/) which works fine but I want to work for all children of a selector currently I have the below but it only applies to divs with class area and I need it to apply on div's with class area and all its children.
$('#container-area .area').contextMenu()
Any ideas on wildcard jquery selectors tried * with no luck
Lee
Upvotes: 0
Views: 663
Reputation: 32107
$('#container-area .area').contextMenu().find('*').contextMenu()
Upvotes: 0
Reputation: 630429
This should work, using .andSelf()
(documentation):
$('#container-area .area').children("div").andSelf().contextMenu();
Upvotes: 2