Click here to Skip to main content
15,904,500 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
what happens if valid id name does not provide in selector using jquery and when we get an undefined and null error in jquery?


What I have tried:

I did not get any valid answer!
I which scenario using jquery we get undefined and null error?
Posted
Updated 10-Sep-19 4:44am
Comments
MadMyche 10-Sep-19 10:34am    
You may want to provide the code in question (both the JS/JQuery AND the HTML) and work on explaining your question better.
verma.vivek 10-Sep-19 10:38am    
I want in details theory that when we have to get an undefined and null error.

1 solution

If the selector you pass to jQuery doesn't match any elements, you will get an empty jQuery object back. You will not get any "undefined" or "null" errors by calling jQuery methods on that empty jQuery object.

Demo[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900