HTML input type?

Is there any special type of input in HTML that is designed to display only values ​​based on, say, another input? When no one can write into it. Or is this a text field with the option disabled?

+3
source share
4 answers
<input type="text" readonly />

Attribute readonlydoes your magic.

+4
source

It is currently very easy to remove the readonly attribute in the browser. I suggested you use a shortcut or range and write a few lines of css codes for this shortcut element so that it looks like an input field.

<label>test value</label>

<style>
label {
    padding:3px;
    border:1px solid black;
    width:200px;
}
</style>
+2
source

readonly javascript div

0

HTML5 output . , , , .

To simply display data, use any regular HTML element, such as por divor span.

If data needs to be transferred according to form data, put it in a hidden element <input type=hidden>.

You can, of course, combine the two, if necessary: ​​separately display the data and include them in the data set of the form.

0
source

All Articles