You can access the value attribute of the selected option using this kind of javascript:
Code:
...
var selectElement = document.getElementById('category_name');
var selectedValue = selectElement[selectElement.selectedIndex].value;
alret (selectedValue);
...
You could gain access to the select element in many ways (I have used an id for simplicity). You could also trigger this by running a function when the select element is changed (when it fires the onchange event).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.