I need something like this:
$('element1 or element2').mouseover(function() { $('element3').show(effects,blah); });
Hope I just missed this opportunity in jQuery docs.
Just use a comma to separate the selectors:
$('element1, element2').mouseover(function() { $('element3').show(effects,blah); });
Comma is CSS syntax for selector grouping .
You can do this with a comma in the selector , or you can use add.
add
$('element1, element2').mouseover(...); $('element1').add('element2').mouseover(...);
Of course, just as you can specify it in CSS, just use a comma separated list:
$('.element1, .element2').mouseover(function() { $('element3').show(effects,blah); });
Source: https://habr.com/ru/post/1791232/More articles:How to show the correct taxonomy management in SharePoint 2010 EditModePanel? - keywordFacebook photos_addTag method not working - phpHow to upload photos from mobile to computer (website) using MMS and PHP? - phpWhere should I add Java files in a web project (WAR) in Maven? - javaMultiple EXEs in Visual Studio solution - putting them in one output folder - .netWhy can't I use .call () in the replace function? - javascriptSpecifying days instead of hours in Team Foundation Server 2010 tasks - c #Scan an eclipse project from an eclipse plugin - eclipse-pluginWhy is ASP.NET-MVC Routing UrlParameter.Optional ignored when using this regular expression? - regexParsing a tree in C # - c #All Articles