Is there any way to check if a div has an id, using jQuery?
I can check if it has an ID value, like this:
<div id="main">...</div>
if ($("#main").length){
// resto do código aqui
}
But what I need is to know if DIV
has id
inside it.
EXAMPLE 1:
I have the following div
<div class="menu"></div>
Here jQuery has to tell me that it does not have id
div
<div class="menu" id='4'></div>
Here jQuery has to tell me that the div has a id
Can you do this?