How do I get the value of the input?
First time in my life trying to link js file and html
And I'm in pain
The bottom line - I wanted to have an input field and a send button
and when the button was clicked, the values from the input field were passed to the function in the js file.
And as a result, after 40 minutes, I found a solution that is very similar to the correct one that DOES NOT WORK ((((((((
it works in jsfiddle, in browser it gives error
what's my problem?
Why wasn't the script included? Before the closing body tag.
Put the line
& lt; script src = "path to js file" & gt; & lt; / script & gt;Anonymous
<input id="elem1" type="text" name="quantity" placeholder="количество">
<input id="butt" type="button" value="кнопка"><br>
To place the code, please use CodePen or similar tool. Thanks you!