Let's say I want to hide multiple divs at once.
$("#something").click(function() { $("#one").hide(); $("#two").hide(); $("#three").hide(); });
How can I reduce the middle three lines to one line?
$('#one, #two, #three').hide();
or give them a class and hide everything at once
$('.class').hide();
Just add such a comma
$("#one, #two, #three").hide();
Just comma separate them :)
$("#something").click(function() { $("#one, #two, #three").hide(); });
Source: https://habr.com/ru/post/1628405/More articles:Clojure: альтернатива использованию мьютекса/блокировки и счетчика - clojureAttributeError: the 'tuple' object does not have the 'encode' attribute - MySQLdb Python - pythonкак использовать `: =` из data.table, когда data.table не загружается - rRunning golang comand in heroku bash - goCustom sound using ionic push notifications - androidXlsxwriter Python string variable - pythonDynamic variable @ * INC not found - perl6Ionic, cordova, telephone, jQuery Bluetooth plugin - jquery pluginsHow to prove June 8, 2015 86401 seconds in Java 8 (new dates API)? - javaЯдро базовой платформы Entity Framework - Требуемое поле для подключения к памяти - entity-framework-coreAll Articles