Jump to content

How does this works?


Drycodez
 Share

Recommended Posts

Chances are you are referring to these sort of statements:document.something.valuedocument.forms['something'].name.valueThose are really old school ways of accessing form elements. This way is not recommended. The preferred alternative is to give id's and use getElementById.You may also be referring to things like this:arr.lengthstr.toUpperCase()These are perfectly acceptable because those statements are accessing builtin properties/methods of objects. You may also come across custom defined objects, properties, and methods. These are also acceptable.

Link to comment
Share on other sites

The general idea is that you have an object, and with the dot, you access a property of this object. The property of an object is itself an object, and return values from functions are also kinds of objects, so you can end up with really long chains of objects if you really want to.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...