[jQuery] [jquery] if element exist

[jQuery] [jquery] if element exist

Assuming "name" is an ID (<tag id="name" ...) then I believe this is what
you're looking for:

if (document.getElementById("name")) { ... some actions ... }

If all of your desired actions are to be performed by jQuery $(), then
$("#name").action().action().action() works well.
> sily question, how to verify if there's an element in the page?
>
> ex. if '#name' exists { }
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/