JavaScript Program to Display Selected Option Using RadioButtons

Write a JavaScript program to display selected option using radiobuttons.

Source Code
    <title>Use of radio button</title>
        function display(SelOption) 
            document.getElementById("info").innerHTML = "You selected: " + SelOption;
    <input type="radio" name="gender" value="Male" onchange="display(this.value)"/>Male</input>
    <input type="radio" name="gender" value="Female" onchange="display(this.value)"/>Female</input>
<p id="info"></p>

"Coding Hub - Learn to code" app now available on Google Play Store