I'm trying to create a calculator which can determine someones snowboard length primarily by their body weight. I had a <select> tag initially but to improve user experience I'm attempting to have an <input> tag where they can just enter their body weight within the parameters of 13 to 113. I cant seem to find any way to get this input field where I can also provide each number given with a value via an <option> tag. Here is the code I'm using so far...
An <option> tag has to be wrapped inside a <select> tag, which creates a dropdown.
Your <input> tag is set to a type of 'number' which is HTML5 and doesn't work in Firefox.
If you're looking at improving the user experience, why not take a look at the jQueryUI library - they offer a slider that may do precisely what you need.
Have a play with this to see it in action (just slide the slider)
There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.
As far as I'm aware there is no HTML only option which allows text entry AND limits the options.
You could use the select tag instead (see http://www.w3schools.com/tags/att_select_form.asp):
Open in new window
...or I guess you could use javascript (probably jquery) to show a warning for invalid entries.