getElementById und jQuery

Kommentieren Jan 09 2013 .txt, .json, .md

Warum muss jQuery da eine eigene Suppe kochen ?

Normales JS:

if(document.getElementById(’theID’)) {

// do stuff

}

else {

// do stuff if not there

}

Das Gleich mit jQuery:

if($(’#theID’).length == “0”) {

// do stuff

}

else {

// do stuff if not there

}

Darauf muss man erst mal kommen ! Warum kann da jQuery nicht einfach false zurück geben, wenn NICHTS gefunden wurde ?