ComputersProgramming

What is HTML input type?

If you have never encountered a markup language, you are unlikely to understand what the HTML input type is. For those who work with HTML, these explanations are useless. But for beginners who are just learning this language, it will be useful to get acquainted with one of the attributes.

Language

What is this HTML and who needs it? For the first time it became known in 1993. It is a standardized tool, conditionally - for creating documents on the Internet. In order not to delve into the uneasy terminology of programmers, all this can be explained easier. Most of the web pages that you see on the network consist of commands and codes. All of them make up this language.

The main application that plays HTML is the browser. It is for him and adapted all the teams. He interprets all the results that can be written in the usual "Notepad", in the formatted text on the screen.

Structure

In order not to be lost in the entire text array, which is written in markup language, and to find there the necessary attributes of HTML -input type, the document is structured. It consists of elements that are enclosed in tags.

These are special labels, endowed with the properties of the text enclosed in the tag. For example, you need to make a paragraph. You take a piece of text to separate it, enclose it in

and

tags. The slash marks (/) usually terminate the command and are called closing. There are tags that do not require closing. For example,
is a label that creates a line break.

In the structure of a document written in HTML, permanent elements are traced. Some are considered compulsory, others can be dispensed with. In general, you can select hyperlinks, text blocks, word processing, lists, objects, pictures, maps, tablets, symbols and forms. The last element will be discussed in more detail.

The form

To find the HTML input type attribute, you need to study the concept of "form". One of the definitions suggests that this is an element that helps the user to enter information on the site for later processing. To explain it easier, you need to remember the web page. You probably saw on the sites different elements in the interface, which are represented by fields for text input, buttons, switches and flags.

Forms are tools for the user. They allow the visitor to search for information on the site, leave comments, participate in surveys, etc. To activate any of the proposed forms on the page, you need to use the

tag.

Feedback

To make forms, you can use one of the most common tags. It is responsible for the elements with which visitors work. So, thanks to this label, it becomes possible to use special text fields, buttons, switches, flags, etc.

If you do not need to collect and analyze information, then this tag does not have to be inside . But if you want the materials left by the visitor to be sent to the server and then analyzed, then the form label is required.

Diversity

Now we go directly to the HTML input attribute. Type is an attribute that indicates the type of the element. In this case, it is completely different. It becomes a text field, a password field, etc. The attribute is multifunctional and can give the user the ability to quickly clear a form filled with an incorrect form, or attach a file.

Values

There are a dozen values for the HTML input type attribute. Text creates a "frame" on the page to enter information. It can be used for different purposes: searching for materials on the page, entering personal data, etc. A similar field is specified by the value of password. Externally it looks like a text, but all the information that is entered there is indicated by "asterisks". This option is often used to prevent others from knowing which password you are entering.

There are two more similar values for the type attribute: checkbox and radio. The first option is a check box. If you need to make a poll on the site, then the checkbox is converted into a check box. And you need to choose several options. The second option is created for the same purpose, but is called a "switch". Allows you to use one answer option.

Many have attributes that mimic buttons in HTML. Input type submit creates a popular button, thanks to which you can send the input data to the server. There is a similar one, called image. It does the same, but it looks like a picture, so as not to look static. There is just a button with a value of button.

As mentioned earlier, thanks to the tag, you can create elements for uploading files or images. To do this, use the value for the type-file attribute. You probably saw a similar element on the web page. Especially where you can download files.

The last value for the HTML input type is hidden. With it, a hidden field can appear on the web page. It does not appear for the user, but helps the developer. For example, if you need to transfer information to the server that was created by him earlier. So there are some tags that are visible only in the file with the code. Also, due to this value, the hidden data is formed for php or js.

Other attributes

In HTML, the form type is not the only attribute. A whole list can be found in any electronic textbook on learning the markup language. For example, you can use align, with which you can determine the alignment of the image. This attribute works not only with forms. It can be used, for example, if you have added a map with your location to the site, but you want to place it in a different way. Then you can give this attribute a value of middle, top, left, etc.

To assign an alternative text to a button, use the alt attribute. In general, an alternative text is necessary for force majeure. Suppose a user has problems with an Internet connection, and the content on the web page is slowly loaded. Due to the fact that the button is represented by a certain image, it may not be downloaded at all. In its place will be an alternative text that you specify. So the visitor can easily find it, even if the pikcha itself does not appear.

The list attribute can help with a list of options. If the user enters data into the text field, a small list of words suitable for him may appear. You can block access and change an item using the disabled attribute. Such attributes are more than 30. They enable the programmer to correct the operation of such elements, set them a value, type, form, etc.

conclusions

In general, knowing all the elements, tags, attributes and their meanings is not easy. Especially if you are just getting started with HTML. Those who work with this language for at least a couple of years can easily operate with most of these codes. But it is better for beginners to use additional information. There are many tutorials that explain the meaning of each element.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.unansea.com. Theme powered by WordPress.