1

If i write

$('.myclass').each(function () {});

and there are no elements of myclass on a particular page, will it create problems?

Thanks.

1 Answer 1

9

no you will be fine, it will basically do nothing. If jQuery finds no elements named ".myclass" it just continues on.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.