-3

What are the valid html elements, that can be contained with in a <input> tag? Haven't found proper documentation regarding this which is why I had to raise the question.

ghost
  • 53
  • 6

2 Answers2

1

The HTML specification is here.

The input element section says:

Content model: Empty.

There are no valid HTML elements allowed inside an <input>.

It also says:

Tag omission in text/html: No end tag

… which makes it impossible to place an element inside it with HTML since to do that you must put the child element between the start tag and the end tag.


See also Mozilla's reference:

Permitted content: None, it is an empty element.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
0

You can't place any element inside an input. An input does not contain any HTML.

Marco Salerno
  • 5,131
  • 2
  • 12
  • 32