Question: how to fetch value from checkbox in javascript?
Answer: document. getElementById('submit'). onclick = function() {
if (document. getElementById('male'). checked) {
alert(document. getElementById('male'). value);
} else if (document. getElementById('female'). checked) {
alert(document. getElementById('female'). value);
}