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
Post a Comment