prototype check if element exists


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. if($('id_of_element') != undefined) {
  2. console.log('Object exists.');
  3. }

URL: http://www.richardcastera.com/2010/02/24/prototype-js-determine-if-an-object-exists-in-the-page-loaded/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.