简体   繁体   English

如何仅在 HTML/JQuery 中获取从 1 到 10 的输入?

[英]How can I take input from 1 to 10 only in HTML/JQuery?

How can I take input only 1 - 10 , ( 1,2,3,4,...,10 ) in HTML input tag?如何在 HTML 输入标签中仅输入1 - 10 , ( 1,2,3,4,...,10 )?

If I enter 9 than the code should not allow me to enter anymore digits.如果我输入9 ,那么代码将不允许我输入更多数字。 And if I enter 1 than I can only enter 0 as the next digit.如果我输入1 ,那么我只能输入0作为下一个数字。

try below mention tag试试下面提到的标签

<input type="number" name="numberInput" min="1" max="10">

you can use您可以使用
for() {}
Method for iterate input tag.迭代输入标签的方法。

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

相关问题 我如何从html表单中获取输入并添加到python脚本中 - How can i take input from a html form and add to to a python script 我如何使用 jquery 在 html 中取值并从其他值中扣除 - How can i take value and deduct it from other in html using jquery 如何将输入标签限制为仅 10 个逗号? - How can I limit the input tag to only 10 Commas? 如何从一种形式的输入字段中获取数据,并使用JQuery使用它以另一种形式填充相同的输入类型? - How can I take data from one an input field of one form and use it to populate the same input type in a different form using JQuery? 我怎样才能从<input>标记到 javascript - How can I take text from <input> tag to javascript 如何从表单中获取实时输入并打印? - How can I take live input from a form, and print it? 如何从 vue 中的跨度 html 中获取值? - How can I take a value from a span html in vue? 如何使用 jQuery 从字符串中删除输入标签? 该字符串还包含其他 html 标签 - How can I remove input tags from a string using jQuery? This string contains other html tags as well Jquery可以直接从表单中获取表单输入,还是必须在脚本中使用SET按钮? - Can Jquery take the form input straight from the form, or do I have to use a SET button in my script? 我该如何获取输入值? - How can i take that input value?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM