I want to make 2 buttons appear onclick. How can I do this with Javascript? The code is supposed to ask a user "How their doing?" and then give them 2 options to choose from.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
function helloName() {
// GET THE USERS INPUT
var userName = document.getElementById("name").value;
// GREET USER WITH THEIR NAME
document.write("Hello " + userName + ", How are you doing today?");
// GIVE USER AN OPTION TO SELECT HOW THEIR FEELING
document.getElementById("show-buttons").style.display = 'block';
};
</script>
</head>
<body>
<h1>JS Skills Test</h1>
<label for="name">Enter Your Name</label>
<input id="name" type="text" placeholder="Enter Your Name">
<button onclick="helloName()">Click Me</button>
<div id="show-buttons" style="display: none;">
<button id="bad">I'm not doing to well</button>
<button id="good">I'm doing wonderful</button>
</div>
</body>
</html>
document.writeafter the dom has finished loading.