I would like to write two variable values into a div container (with id myDiv) using innerHTML. My Div container is only showing the second value.
<button type="button" onclick="myFunction()">Click me</button>
<input type="text" id="First" name="firstname">
<input type="text" id="Last" name="lastname">
<div id="myDiv"></div>
<script>
function myFunction() {
var x = document.getElementById("John").value;
var y = document.getElementById("Mail").value;
document.getElementById("myDub").innerHTML=x;
document.getElementById("myDub").innerHTML=y;
}</script>