plz help to find the error
<html> <head> <title>mark cal</title> </head> <body> <h3>get gender</h3> <label>gender</label> <input type="radio" value="male" name="gen">male <input type="radio" value="female" name="gen"> female <button onclick=" getResult() ">view</button> <script> function getResult() { var gender=document.getElementsByClassName("gen"); if(gender[0].checked) { alert(gender[0].value); } else if(gender[1].checked) { alert(gender[1].value); } else { alert("slect something"); } } </script> </body> </html>