I'm just having some fun screwing around, and so I built this. It should be taking the values from the forms, putting them through the !a != !b
mockup logical XOR, and then outputting to the <p>
tag, but I'm not sure why it's not working. Could anyone help me with it?
window.onload = function(){
function xOR() {
var a = document.getElementById("aForm");
var b = document.getElementById("bForm");
var output = (!a != !b);
document.getElementById("xorOutput").innerHTML = "Output Value: " + output;
}
};
<h2>random testing</h2>
<h3>Logical XOR Test</h3>
<h4>First Input Value</h4>
<form id="aForm">
<input type="radio" name="aValue" value="true">True
<br>
<input type="radio" name="aValue" value="false">False
</form>
<h4>Second Input Value</h4>
<form id="bForm">
<input type="radio" name="bValue" value="true">True
<br>
<input type="radio" name="bValue" value="false">False
</form>
<br>
<button onclick="xOR()">Perform XOR</button>
<p id="xorOutput"></p>