Which of the following is the correct way to check the existence of an element in jQuery other than the following code? if ($(selector).length>0) { // Do something }
Correct Answer: jQuery.fn.exists = function(){return this.length>0;} if ($(selector).exists()) { // Do something }
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More JQuery MCQ Questions