marioosh
marioosh

Reputation: 28576

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

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

jQuery('.myclass').ready(function(){ alert('ready'); })

Upvotes: 3

Views: 264

Answers (2)

duckduckgo
duckduckgo

Reputation: 1295

load() dont work in all elements, it is solely for img, iframe, document etc. ready() do work but inside function are failing

Upvotes: 0

Barrie Reader
Barrie Reader

Reputation: 10713

Yes, although I would recommend using .load()

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

Upvotes: 3

Related Questions