+ 2

How to get value of input type='button' into a variable?

3rd Apr 2018, 3:00 PM
Evil Dog
Evil Dog - avatar
2 Answers
+ 9
You can access the button's value by getting the DOM with JavaScript as usual, and then use the value property will do. Therefore something like:- var btnValue = document.getElementById('btnId').value; would work. 😉
3rd Apr 2018, 3:07 PM
Zephyr Koo
Zephyr Koo - avatar
+ 2
thx <3
3rd Apr 2018, 3:16 PM
Evil Dog
Evil Dog - avatar