Presentation is loading. Please wait.

Presentation is loading. Please wait.

Understanding Objects. value Example: txtFirstName. The dot notation is the key that opens the door to the house. Properties room Methods room Events.

Similar presentations


Presentation on theme: "Understanding Objects. value Example: txtFirstName. The dot notation is the key that opens the door to the house. Properties room Methods room Events."— Presentation transcript:

1 Understanding Objects

2 value Example: txtFirstName. The dot notation is the key that opens the door to the house. Properties room Methods room Events room id value size background color… focus() blur() - remove focus select()… OnFocus OnBlur - loses focus OnChang e OnClick … Top down View Example: A TextBox Object …with 3 rooms An Object is like a house…

3 Remember: The dot (a period) gives you access to all the properties, all the methods, and all the events inside the object.

4 Also Remember: You must use JavaScript’s getElementById() function to GET the object first.

5 If you don’t use getElementById(), you can’t even SEE the house! It doesn’t even exist for you.

6 A Code Example // declare a variable to hold the textbox object var txtFirstName; // grab the object using getElemtnById() and assign it to the variable txtFirstName = document.getElementById(“txtFirstName”); // display the value (the actual text) of the textbox alert(txtFirstName.value); Notice the dot – the key that opens the door to the object!

7 Thanks for watching.


Download ppt "Understanding Objects. value Example: txtFirstName. The dot notation is the key that opens the door to the house. Properties room Methods room Events."

Similar presentations


Ads by Google