javascript - How to select multiple jQuery objects? -


like if wanted select both document , window elements.

$(window, document).dostuff(); 

doesn't work. because according docs, 2nd argument "context" thing...

basically i'm looking alternative too

$(window).dostuff(); $(document).dostuff(); 

var 1   = $("#1"); var 2   = $("#2"); var 3 = $("#3"); var 4  = $("#4");     $([one, two, three, four]).each(function() {         // function here     }); 

the document ready event executes when html-document loaded , dom ready, if graphics haven’t loaded yet.

if want hook events elements before window loads, $(document).ready right place.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -