Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Terminology: Are properties the same as attributes? HTML / JS

I get confused when Andrew speaks of properties and attributes.

In HTML an Element attribute is something in the lines of:

IMG -> Src INPUT -> type, name, value, etc.

When telling us to change a TAG property, does it means the same as attribute?

Like img.src, input.type, etc?

I believe he means the same and is intending that you change the TAG attribute. While thinking about this I came across this more detailed explanation on the subject: http://javascript.info/tutorial/attributes-and-custom-properties

Hey, thanks for the link. Interesting reading ;)

1 Answer

In javascript a property is what a variable is called when it's used inside of an object.

Outside of object = variables & functions Inside of object = properties & methods

But they are the same thing. Just different terms depending on where it is used.

If he is using the term property when referring to HTML then I could assume that he is indeed referring to element attributes or the attribute's value.