0

A while ago there was a term that I remembered that described two categories of elements. I forgot the term and I want to know what that term was. The information I can remember is that the first category of elements get their values from within HTML like <p> or <a> or <ul> but there is another category of elements which get their values from "outside" of HTML like <img> or <input type="textbox">. I want to know the terminology for these types.

Edit - I've went through Zomry, Difster and BoltClock's answers and didn't get anything. So I remembered some extra piece of information and decided to add it. The two categories are Lazy Opposites of each other. For example if one is called xyz, then the other is called non-xyz.

Arno Lorentz
  • 725
  • 1
  • 5
  • 13
  • I’m not sure but I think you’re referring to containers versus standalone elements, also named self-closing tags. You get a general “logic” about whether an element belongs to one category or the other, but few exceptions go againts intuition, such as ` – Watilin Jul 15 '17 at 16:04

4 Answers4

2

The HTML specification mentions for tags like <img> and <input> the following: Tag omission in text/html: No end tag.

Tags with an end tag are defined as: Tag omission in text/html: Neither tag is omissible.

So as far as I can find, the HTML spec does define a technical name for this, apart from void versus normal elements, so what Watilin pointed out in the comments should be fine: standalone vs containers.

As an added side-note: HTML has a lot more HTML content categories. You can find a complete overview at the HTML spec here: https://html.spec.whatwg.org/multipage/indices.html#element-content-categories

Also interesting to read to visualize that a bit better: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories

Zomry
  • 1,141
  • 12
  • 14
2

Probably you mean replaced elements (and non-replaced, respectively)?

However, the distinction between them is not so unambigous. For example, form controls were traditionally considered replaced elements, but the HTML spec currently explicitly lists them as non-replaced (introducing the "widget" term instead).

Ilya Streltsyn
  • 13,076
  • 2
  • 37
  • 57
  • 1
    @Arno Lorentz: Just to clarify though, replaced and non-replaced are CSS terms, not HTML terms. The concept of a "value" as described in your question doesn't exist in CSS. – BoltClock Jul 16 '17 at 09:59
  • Oh. Learned something new. Thanks @BoltClock. – Arno Lorentz Jul 30 '17 at 15:32
1

Elements whose contents are defined by text and/or other elements between their start and end tags don't have a special category. Even the HTML spec just calls them normal elements for the most part in section 8.1.2.

Elements whose primary values are defined by attributes and that cannot have content between their tags are called void elements. img and input are indeed two examples of void elements. Note that void elements are not to be confused with empty elements; see the following questions for more details on that:

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
0

<input type="text" id="someField" name="someField"> With an input selector, you can get a value from it like so (with jQuery): $("#someField).val();

Where as with a paragraph or a div, you don't get a value, you get the text or html. <div id="someDiv">Blah, blah, blah</div> You can get that with jQuery as follows: $("#someDiv").html();

Do you see the difference?

Difster
  • 3,264
  • 2
  • 22
  • 32