What's the point of having hidden input in HTML? What are common uses for this?

后端 未结 12 1157
无人共我
无人共我 2020-12-01 14:51

I don\'t see the benefit of having hidden input? If you set the value of the hidden input why not just use that value at the point where you reference this hidden input?

12条回答
  •  时光说笑
    2020-12-01 15:00

    As name implies, Hidden fields are similar to other input fields except one difference i.e, hidden fields are not actually shown to the user and hence can not be edited by the user.Its value can only be set at the time of execution i.e. may be form submitting which posts the data to the server. But the data set on the html page i.e. name/value can be seen in the html source of the page (view source of the page).

提交回复
热议问题