jQuery Selectors
Jack Franklin gibt eine Tips für “Clever jQuery Selectors”.
Ein Beispiel:
If you can, avoid going back up to parent level.
$("elem").find("p").css("display", "none").parent().find("h2").css("display", "none");(…) The code could be cut down:
$("elem").find("p").css("display", "none").siblings("h2").css("display", "none")But this can still be improved:
$("elem").children("p, h2").css("display", "none");

