Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In web development, you often hear the terms "element" and "control". The term "element" is often associated with HTML, and you hear the term "control" most often in Asp.NET development... but the w3c refers to controls in the Forms in HTML documents recommendation, blurring the lines a little.

What is a control and what is an element? How are they the same and how are they different? Is one a generalization of the other?

share|improve this question
up vote 5 down vote accepted

Element refers to DOM Elements. In other words, every part of the page is an element. Javascript/DHTML is all about manipulating these elements to make the page interactive.

A control, in the W3C sense, is a type of element that accepts user input. Things like textboxes, radio buttons, and submit buttons are all controls under this definition.

The ASP.Net definition of a control is different from the W3C version. In ASP.Net, a control is a template that takes data and formats it as HTML. So, for example, a GridView control takes the data that you give it and formats it as a <table>. A Label formats data as a <span>. ASP.Net controls allow you to work at a higher level of abstraction than the W3C DOM. You can work with Labels, GridViews and Repeaters, rather than having to work out the HTML generation yourself.

share|improve this answer
That would of been my answer too! – webdad3 Mar 31 '11 at 14:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.