Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>
<html>
<head>
	<title>To Do List</title>
</head>
<body>


<h1>To Do:</h1>
<button id = "submit" onclick="addTD()">
	GET SOMETHING DONE
</button> 

	<ol id = "todo">
	</ol>

<h1>
	Done:
</h1>
	<ul id = "done">
		
	</ul>

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

              
            
!

CSS

              
                button {
  background-color:#EBEBEB;
  margin-left:5px;;
}
              
            
!

JS

              
                //THIS IS A FUNCTION TO ADD A NEW ITEM TO THE "TO DO" LIST
function addTD() {
let submit = prompt("WHAT ARE YOU GOING TO PUT OFF UNTIL TOMORROW?");
//CREATING THE VARIABLES FOR THE LISTS
let todo = document.getElementById("todo");
let done = document.getElementById("done");

//CREATING NEW ELEMENT
let newitem = document.createElement("li");
//WRITING WHAT WILL GO IN THAT ELEMENT
let itemtext = document.createTextNode(submit);
// ADDING CHILD  TEXT NODE "test" TO ITS PARENT, </li>
let fullitem = newitem.appendChild(itemtext);
// ADDING CHILD "newitem" TO ITS PARENT
//
todo.appendChild(newitem);
//FUNCTION TO CREATE "DONE" BUTTON
	 function button(){
	 	let newbutton = document.createElement("button");
	 	//ADDING HTML CLASS
	 	newbutton.classList.add("done");
	 	let buttontext = document.createTextNode("Done");
	 	//ADDING BUTTON TO LIST ITEM
	 	newbutton.appendChild(buttontext);
	 	//PUTTING IT ALL TOGETHER
	 	newitem.appendChild(newbutton);

	 	//REMOVING THE ITEM FROM THE LIST
	 	newbutton.onclick  = function move(){
	 		//CLONING THE TEXT BEFORE MOVING IT TO "DONE"
	 		let clone = fullitem.cloneNode(itemtext);
	 		newitem.remove();
	 		let doneitem = document.createElement("li");
	 		let donetext = document.createTextNode(submit);
	 		let fulldone = doneitem.appendChild(donetext);

	 	done.appendChild(doneitem);
    
      }
     
	 }
button();
   

}
 






              
            
!
999px

Console