---
title: "can&#39;t figure out how to link my javascript into my html"  
description: "can&#39;t figure out how to link my javascript into my html"  
author: "E E Cummings"  
published: 2013-08-19  
updated: 2013-08-19  
canonical: https://www.mindstick.com/forum/1404/can-39-t-figure-out-how-to-link-my-javascript-into-my-html  
category: "javascript"  
tags: ["javascript"]  
reading_time: 2 minutes  

---

# can&#39;t figure out how to link my javascript into my html

Hi!\

I"m [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to follow a [tutorial](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap) [online](https://www.mindstick.com/articles/13083/benefits-of-students-who-can-get-online-assignment) on how to make a Todo list

I finished the following [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) as follows

```
<!doctype html><html>    <head>    <title>To do
list with html and javascript</title>    <style>    ul { list-style:
none; padding: 0; margin: 0; width: 400px;}    li { border: 1px
solid #ccc; background: #eee; padding: 5px 10px; color: #000; }    li span {
padding-left: 10px; cursor: default;}    .checked {
text-decoration: line-through; font-weight: bold; color: #c00;}        </style>    </head>    <body><h1>To Do List</h1><p><iput type="text"
id="inItemText"/>    <ul id=
"todolist"></ul><script type= "text/javascript"
src="todo.js"</script>    </body></html>and // Each item should look like <li><input type =
"checkbox"/> do tutorial</li>function updateItemStatus (){    var cbId =
this.id.replace("cb_","");    var itemText =
document.getElementbyId("item_" + cb.Id);    if (this.checked)
{        itemText.className
= "checked";}   else {       
itemText.style.fontWeight = "";}}function removeItem(){    var spanId =
this.id.replace("item","");   
document.getElementById("li_" + spanId).style.display =
"none";} function addNewItem(list, itemText){    var date = new Date ();    var id =
"" + date.getHours() + date.getMinutes() + date.getSeconds() +
date.getMilliseconds();     var listItem =
document.createElement("li");    list.Item.id =
"li_" + id;    var checkbox =
document.createElement("input");    checkbox.type =
"checkbox";    checkbox.id =
"cb_" + id;    checkBox.oneclick
= updateItemStatus;    var span =
document.createelement("span");    span.id =
"item_" + id;    span.innertext =
itemText;    span.ondblclick =
removeItem;    listItem.appendChild(checkbox);   
listItem.appendChild(span)   
list.appendChild(listItem);}var inItemText =
document.getElementbyId("inItemText");inItemText.focus();inItemText.onkeyup = function (event) {    // 13 means Enter    if (event.which ==
13) {    var itemText =
event.which;    if (itemText ==
"" || itemText == " ") {        return false;    }   
addNewItem(document.getElementById("todolist") itemText);   
inItemText.focus();   
inItemText.select(); };
```

I have both [files](https://www.mindstick.com/articles/23302/the-importance-and-advantage-of-keeping-your-important-files-on-the-cloud) saved in the save folder on my desktop. The [javascript](https://www.mindstick.com/articles/874/how-to-create-watermark-text-for-textbox-by-using-javascript) is still not [coming up](https://yourviews.mindstick.com/view/80/finally-some-good-news-coming-up-for-rajeev-chowk-metro-station). Did I type something in wrong. I'm just trying how to [link](https://www.mindstick.com/articles/23633/link-builder) the javascript to my [html](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) [sorry](https://yourviews.mindstick.com/view/81321/ekta-kapoor-s-sorry-is-not-acceptable) its my first time doing this.

\

## Replies

### Reply by shreesh chandra shukla

Hi!

you forgot >

<script type= "text/javascript" src="todo.js"></script>

now it will work


---

Original Source: https://www.mindstick.com/forum/1404/can-39-t-figure-out-how-to-link-my-javascript-into-my-html

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
