Jump to content

How does this works?


Drycodez

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...