JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<body>
<input type="radio" name="type" value="Recommended COURSE2" onclick="func();"/>Bias</br>
<input type="radio" name="type" value="Recommended COURSE3" onclick="func();"/>Culture</br>
<input type="radio" name="type" value="Recommended COURSE4" onclick="func();"/>Stigma</br>
</body>
</html>
CSS
form label {
display: block;
}
form button {
margin: 20px 0;
}
JavaScript
function func()
{
var type = document.getElementsByName("type");
if(type[0].checked)
{
var val= type[0].value;
alert("val");
}
else if(type[1].checked)
{
var val= type[1].value;
alert("val");
}
else if(type[2].checked)
{
var val= type[2].value;
alert("val");
}
}