Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams


Checking if an object property exists in JavaScript

checking object property javascript

  • Please log in to reply
 

#1 SmartWeb

SmartWeb

    Senior Member

  • Designer
  • 271 posts

Posted 06 December 2012 - 10:14 PM

To check the existence of an object property in JavaScript do the following:
1.First rightclick on the HTML page that has the JavaScript code. Go to ‘Open With’ to see the list of compatible programs, and select ‘Notepad’
2.Press Ctrl +F , and the Find dialog window will display. Type in ‘<script’ and then press Enter and then scroll down to the JavaScript text.
3.Using the If statement you have to check for undefined and null values for an element. if(typeof(myv) !== 'undefined' && va != null) {
alert("The Object is defined");
}
4.Press Ctrl +S to save your changes.





Also tagged with one or more of these keywords: checking object property, javascript

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users