如何在Javascript中比较ID

我试图比较一个简单的代码,如果用户单击该按钮,则输出将显示适当的答案,但我似乎找不到任何正确的方法来执行此操作。

<html>
<body>
<p>Gender</p>
    <label><input type="radio" name="gender" id="male" value="Male">Male</label>
    <label><input type="radio" name="gender" id="male" value="Female">Female</label>
    <br>
    <br>
    <button onclick="myFunction()">Try it</button>
    <p id="demo">
<script>
function myFunction() {
  var x = document.getElementById("demo").value;
  var m = document.getElementById("male").value;
  var f = document.getElementById("female").value;
    if(x === m)
        x.innerHTML = "You are male.";
    else if(x === f)
        x.innerHTML = "You are female.";
}
</script>

</body>
</html>