Function to display component from a radio
function displayRadio() { var name = document.getElementById("radioInput").value; var radioValue = $("input[name='radiobtn']:checked").val(); if (radioValue) { alert("You selected " + name + ": " + radioValue); } }