Build a Roman Numeral Converter Project - Build a Roman Numeral Converter

Tell us what’s happening:

Hello,

this states that none of my task have been completed. including my input, p, span elements haven’t been created… Is this just a bug. Thanks!

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Learn localStorage by Building a Todo App</title>
  <link rel="stylesheet" href="styles.css" />
</head>
<body>

<input id="number">
<button id="convert-btn">Convert</button>
<div id="output"></div>
<span id="output"></span>
<p id="output"></p>



</body>
</html>
/* file: script.js */
const input = document.getElementById("number");
const convert = document.getElementById("convert-btn");
const output = document.getElementById("output");

const numeral = [
  ["M", 1000],
  ["CM", 900],
  ["D", 500],
  ["CD", 400],
  ["C", 100],
  ["XC", 90],
  ["L", 50],
  ["XL", 40],
  ["X", 10],
  ["IX", 9],
  ["V", 5],
  ["I", 1],
],

convert.addEventListener("click", () => {
  if (!input.value) {
    output.innerText = "Please enter a valid number"
  }
})
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36

Challenge Information:

Build a Roman Numeral Converter Project - Build a Roman Numeral Converter

Hello,

i’ve linked the javascript to my html but it still does not work. Sorry I was missing that

Welcome to the forum @Tsunami

Did you notice the syntax error in the console?

SyntaxError: unknown: Identifier ‘convert’ has already been declared. (21:0)
19 | ],
20 |
21 | convert.addEventListener(“click”, () => { | ^
22 | if (!input.value) {
23 | output.innerText = “Please enter a valid number”
24 | }

You can view it by clicking on the Console button.

Happy coding

and if you think that the error doesn’t make sense… there is a comma at the end of the numeral array, so const for numeral is also targeting convert.
Always end each line with a semicolon