Nic Hubbard wrote:
I am thinking I could use:

if ( $('#myDiv').length ) {
  // Run my scrip there
}

One of the strengths of jQuery is that this is probably not necessary. Almost everything you care to do on the jQuery object returned by your selector call will run through a forEach() call. So if there are no matching elements, then the call will return quite quickly.

  -- Scott

Reply via email to