Jump to content

Variables and Attributes


RivkaS

Recommended Posts

The HTML tutorial talks about Variables and Attributes but does not give an explanation or definition of what is what, what does what - where can I find it or can somebody explain it? :)Thank youR.

Link to comment
Share on other sites

HTML does not have variables as it is a markup language not a programming language.HTML has tags and attributes. A tag for example is <a> which makes a link. An attribute of the tag <a> is href (<a href="url to page">Text</a>).an attribute is a setting of the tag which defines how the tag should act. The href attribute tells the link where to go when clicked.

Link to comment
Share on other sites

HTML doesn't really have variables, it only has attributes.They are similar in nature in that they both can be looked at like a question and answer.In HTML you might code this:<font size="6">text</font>where the question is what size should the browser assign this this text - the answer being 6. For HTML size is an attribute and 6 is its assigned value.Attributes are static in that you can not make up and attribute like<font shade="dark">text</font>will not work.A variable takes on the same premise - a question and an answer, but you get to make everything up. These are used by server side scripting languages like asp, php, and coldfusion.In coldfusion you might code this:<cfset pagetitle="Variables vs. Attributes 101">where you are basically say, I want this question "what is the page title" available anywhere on the page so that when I choose to output it, I get the answer (or its assigned value) "Variables vs. Attributes 101".<cfoutput>#pagetitle#</cfoutput>And that would produce that text.So both variables and attributes take on the task of asking a question as well as answering one. The attribute is restricted by what it associated with where the variable can pretty much be whatever it wants.Does that help?

Link to comment
Share on other sites

...For HTML size is an attribute and 6 is its assigned value.Attributes are static in that you can not make up ....Does that help?
Yes, this is it. Looking through my printouts, I think I mixed the expressions and was thinking of Attributes and Values. Thanks a lot, now I can go on.R.
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...