If previously asked, then sorry , i was not able to locate it.

So here is a html file :index.html

```
<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title>ToDoList</title>
    <script> src="AddItem.js" </script>
    <script> src="RemoveItem.js" </script>
</head>
<body>
    <h1> Write to Add to List </h1>
    <br>
    <br>
    <input type="text" id="inpu">
    <input type="button" onclick="/AddItem.js/add()" value="submit">
    <div>
        <ul id="list">

        </ul>
    </div>
</body>
</html>

```

And here is the JavaSCript file: AddItem.js

```
var n=0;
function add() {
    if(n==0)
    {
        var ul = document.getElementById("list");
        var li = document.createElement("li");
        li.appendChild(document.createTextNode("Four"));
        li.setAttribute("id", "element4"); // added line
        ul.appendChild(li);
        alert(li.id);
    }
}

```

So i am getting errors, i am unable to link the function add() to the button in my html file, i tried writing only the function name, but still doesn't work.
I also heard of something "window.onload" , but dont know how that will help.

yes i tried using AddItem.js as a file name, but i get error :SyntaxError: invalid regular expression flag a

-A JS newbie here