Can I use .ready () for other elements of a DOM document?

Is ready () for document only or can I use this function for other elements. Example below:

jQuery('.myclass').ready(function(){ alert('ready'); })
+3
source share
2 answers

Yes, although I would recommend using .load()

$('#element').load(function() {
   //do stuff!
});
+3
source

load () does not work in all elements, it is intended exclusively for img, iframe, document, etc. ready () does the job, but the internal function does not work

0
source

Source: https://habr.com/ru/post/1789698/


All Articles