简体   繁体   English

数字输入不显示值

[英]number input not showing value

I have several number inputs written in ruby. 我有几个用红宝石写的数字输入。 When I type in a number value inside the input, I assumed that whatever number is inside the field would show up as a value attribute inside the input html. 当我在输入内容中键入数字值时,我假设字段中的任何数字都将在输入html中显示为value属性。 But when I inspect the number input, the value does not show. 但是当我检查输入的数字时,该值不显示。

Why is that? 这是为什么?

here is my ruby number input code: 这是我的红宝石编号输入代码:

        <%= number_field_tag 'xsmall', nil, in: 1...100000%>

图片

When you enter a value into an input, it will not show up in the HTML. 当您在输入中输入值时,它不会显示在HTML中。 the point of value="2" in the HTML is to tell the browser to pre-populate the input with that information HTML中value="2"的意思是告诉浏览器使用该信息预先填充输入

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM