<!DOCTYPE html>
<html>
<head>
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<link rel="stylesheet" href="style.css">
<link href="http://fonts.googleapis.com/css?family=Droid+Sans" rel="stylesheet" type="text/css">
<script src="script.js"></script><title>My Cool Interactive List</title>
</head>
<body>
     <div class="listContainer">
         <div class="list">
             <ul>
                
             </ul>
         </div>
     </div>
     <br />
     <div class="handlerForm">
         <form name="leForm">
             <h2>Enter something to add:</h2>
             <input type="text" name="area51" class="area51">
             <br/><br/>
             <div class="submittanceSpecialistDiv">
                 <a href="#" class="submittanceSpecialist">Press me to submit!</a>
             </div>
         </form>
     </div>
     <br /><br />
     <h3 class="hint">Hint: Click a list item to remove it!</h3> 
</body>
</html>
/* Reset */

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, code,
del, dfn, img, ins, kbd, q, s, samp,
small, strike, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video, iframe {
    margin: 0;
    padding: 0;
    border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* Main css */

body {
 background: #111;
 color: #999;
 font-family: 'Droid Sans', Verdana, Arial, sans-serif;
 padding: 0 0 500px 0;
}

.listContainer {
 width: 100%;
 height: 3em;
 background: #000;
}

.list {
    font-size: 2em;
    line-height: 1.3em;
}

.list li {
    display: inline;
    list-style-type: none;
    color: #fff;
    padding: 0 0 0 15px;
}

.handlerForm {
    margin: 0 0 0 15px;   
}

.handlerForm h2 {
    margin: 0 0 15px 0;
}

.handlerForm input.area51 {
     background: #333;
     border: 0;
     width: 20em;
}

.handlerForm input.area51:active, input.area51:focus {
    background: #999;
    color: #222;
}

.submittanceSpecialist {
    margin: 0 0 0 20px;   
}

a, a:active {
    text-decoration: none;
    color: #eee;
    font-size: 1.5em;
}

a:hover {
    color: #aaa;
    
}

.hint {
    font-style: italic;
    font-size: 1.2em;
    margin: 0 0 0 15px;
}
$(document).ready(function() {
    $('.submittanceSpecialist').click(function(){
        var toAdd = $('input[name=area51]').val();
        $('.list ul').append('<li class="item">'+toAdd+'</li>');
    });
    
    $(document).on('click','.item', function(){
        $(this).remove();
    });
});
Created from scratch
325 forks
32749 views

Browse more Codebits