When I select a radio button then click the download button, nothing happens. No alert shows up or anything.
Here is my code right now:
HTML:
<form id="Resume_Select">
<input type="radio" name="resume_type" value="Economics" >Economics
<br />
<input type="radio" name="resume_type" value="MIS" >Management Information Systems
<br />
<button onClick="resume_select()"> Download</button>
</form>
JavaScript:
<script>
function resume_select(){
var radios = document.getElementByName('resume_type');
for(var i = 0, length = radios.length; i<length;i++){
if(radios[i].checked){
var resume = radios[i].value;
alert(radios[i].value);
break;
}
}
</script>
It should be getElementsByName
plural not getElementByName. First thing that jumped at me.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments