JSFiddle - React, Tailwind, and code Playground
HTML
<p> <strong>1. This is the first question?</strong>
<br />
<input type="radio" name="op1" value="anw1">Option 1
<br>
<input type="radio" name="op1" value="anw2">Option 2</p>
<p> <strong>2. This is the second question?</strong>
<br />
<input type="radio" name="op2" value="anw1">Option 1
<br>
<input type="radio" name="op2" value="anw2">Option 2</p>
<input type='button' value='Get result!' onClick='Submit()' />
<br />
JavaScript
function Submit() {
var op1= document.getElementsByName('op1');
var op2= document.getElementsByName('op2');
if (op1[0].checked && op2[0].checked) {
alert("This would be if both options one were selected");
} else if (op1[1].checked && op2[1].checked) {
alert("This would be if the the seconds ones were selected");
} else {
alert("This would be if neither were true");
}
}