2009-12-20 6 views

Répondre

3

Pour la présence d'une div:

if ($("div").length > 0) { 
    // theres a div 
} 

Ou un élément particulier avec un ID:

if ($("#id").length > 0) { 
    // it exists 
} 
0
var divExists = !!$('div').length;