I have to find an element in the DOM and if the element exits jquery function should return false.How can i do this?
I did like this but doesnot work.
if($(‘.myclass’).find(‘#id’)== true) return false;
I have to find an element in the DOM and if the element exits
Share
Generally, jQuery functions that take a selector return a jQuery object that is like an array – you can check its
.lengthproperty to see how many elements matched.