0

I am a very new programmer/first-time poster here and I am trying to do a couple of practice projects to work on my skills. While working on my to-do list js I haven't tried much since I really have no experience with an error like this. It showed (index):486 crbug/1173575, non-JS module files deprecated in the console, and displayed my C drive in the browser. I looked around a bit and according to some it could be a chrome extension maybe, I figured I would come here first before I messed something up. Any and all criticisms of code and post are welcome, help me learn, please.

HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" type="text/css" href="index.css">
    <title>To Do List</title>
  </head>
  <body>
    <div class="container">
      <div class="headerContainer">
        <h2 class="header">To Do List</h2>
      </div>
      <form class="inputForm" id="inputForm" method="get" action="/">
        <label class="inputLabel" id="inputLabel">Input Task Here</label>
        <input class="inputText" id="inputText" type="text" value="">
        <input class="submitButton" id="submitButton" type="submit" value="Submit">
      </form>
      <div class="outputListContainer" id="outputListContainer">
        <ol class="outputList" id="outputList">

        </ol>
    </div>

    <script src="index.js">
    </script>
  </body>
</html>

Javascript

var toDoList = [];

var inputTextValue = document.getElementById(inputText).value;

inputTextValue.addEventListener('click', event => {
  event.preventDefault();
  toDoList.push(inputTextValue);

});

for (var i = 0; i < toDoList.length; i++) {
  var node = document.createElement("li");
  var listText = document.createTextNode("toDoList[i]");
//  console.log(toDoList);
  node.appendChild(listText);
  document.getElementById(outputList).appendChild(node);
}

CSS

.outputListContainer {
  height: 500px;
}
.outputList {
  height: inherit;
}
TinyBFG
  • 1
  • 2
  • "and displayed my C drive in the browser" — That's the URL you specified in the `action` of the `
    ` you are submitting by clicking a submit button.
    – Quentin Jun 05 '21 at 22:35
  • `inputTextValue` isn't an element. You can't call `addEventListener` on it. – Quentin Jun 05 '21 at 22:37
  • Beautiful, I'm not seeing that error anymore, thanks guys I appreciate you both. – TinyBFG Jun 05 '21 at 22:44

0 Answers0