There is such a form:
<form id="calc"> <select name="choice"> <option value="1">Вариант 1</option> <option value="2">Вариант 2</option> <option value="3">Вариант 3</option> </select> </br> <input type="text" name="num" size="20" maxlength="20"></input> </br> <input disabled name="result" id="result"></input> </br> <button value="submit" onclick=()>Result</button> </form>
and there is a certain variable var a=1
Question 1. How can I change the contents of the result
field to the value of this variable?
Question 2. How to implement a selection check in the <select>
block? For example, if an element with value=1
selected, then a certain function will be executed.
Question 3. How to get the value of the field num
and put it in the variable b
?