Tell us what’s happening:
Describe your issue in detail here.
Is there a reason why question 4 is not showing complete for me? The div innerHTML is changing to the correct text if the input field is empty:
" When you click on the #convert-btn
element without entering a value into the #number
element, the #output
element should contain the text Please enter a valid number
." ### Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/styles.css">
<script src="./script.js"></script>
<title>Document</title>
</head>
<body>
<input id="number">
<button id="convert-btn"></button>
<div id="output"></div>
</body>
</html>
/* file: styles.css */
/* file: script.js */
const convertButton = document.getElementById('convert-btn');
const numberInput = document.getElementById('number');
const outputDiv = document.getElementById('output');
console.log(numberInput)
convertButton.addEventListener('click', () => {
if(numberInput.value === ""){
outputDiv.innerHTML = "Please enter a valid number"
}
})
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Challenge Information:
Build a Roman Numeral Converter Project - Build a Roman Numeral Converter