Here is a sample project that can be used as an example for the TECHS class.
http://www.caffeinatedcoding.org/examples/todo/todo.htm
When you enter text into the textbox and once you hit enter(firefox only) or tab, then the page starts a list with the text that was entered into the textbox. If you don't like the item in the list, click on the text and it is removed.
This is kindof a dumb thing, but it demonstrates how html, CSS, and Javascript can work together.
Below is the code...
For fun put it into a page on your computer and play with it. Who cares if you screw it up, you can always come back here and get it again.
<html>
<head>
<title>To Do List </title>
<style type="text/css">
<!--
.inputbox { width:800px; height:100px; text-align:left; vertical-align:middle; color:#ffffff; font-size:20pt;}
.listbox { border:1px; border-style:dashed; background-color:#665533; }
.list { color: #002277; background-color: #665533; font-family: Corbel, Arial Black, Arial; font-size: 30pt;}
.listitem { background-color:#774499; width:90%;}
.listitem-alt { background-color:#550077; width:90%; }
body { background-color:#775500; }
input { font-family: Corbel, Arial Black, Arial; font-size: 30pt; color:#669944; }
-->
</style>
</head>
<body >
<script language="javascript" type="text/javascript">
<!--
var blnAlternate;
function AddItem()
{
var lstToDo = document.getElementById("lstToDo");
var txtItem = document.getElementById("txtAddItem");
if (txtItem.value != '')
{
var lstItem = document.createElement("li");
if (blnAlternate == true)
{
lstItem.innerHTML= "<span class='listitem-alt' onclick=RemoveItem('" + txtItem.value + "')>" + txtItem.value + "</span>" ;
blnAlternate = false;
}
else
{
lstItem.innerHTML= "<span class='listitem' onclick=RemoveItem('" + txtItem.value + "')>" + txtItem.value + "</span>" ;
blnAlternate = true;
};
lstToDo.appendChild(lstItem);
txtItem.value='';
focus=txtAddItem;
};
};
function RemoveItem(strItem)
{
var lstToDo = document.getElementById("lstToDo");
for (index=0;index<= lstToDo.childNodes.length;index+=1)
{
var lstItem = document.createElement("li");
lstItem = lstToDo.childNodes[index];
if (lstItem.innerHTML.indexOf(strItem) > 0)
{
lstToDo.removeChild(lstItem);
};
};
}
//-->
</script>
<div id="divAddBox" class="inputbox">
Build your own todo list<br />
Enter items in the box below and they will appear in the todo list.
<input type="text" id="txtAddItem" onchange="AddItem()" />
</div>
<div id="divList" class="listbox">
<ol id="lstToDo" class="list"></ol>
</div>
</body>
</html>