A Pen By Sara Vieira

Pen Settings

↑ Insert the most common viewport meta tag

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource
via CSS Lint

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource
via JS Hint

Code Indentation


Save Automatically?

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

Want a Run Button?

If active, the preview will update automatically when you change code.


	<form action="#" method="POST">
		<label for="name">Name:</label>
		<input type="text" name="name" id="name" required autofocus/>
		<label for="number">Number</label>  
		<input tpe="tel" name="number" id="number" required/>
		<label for="friend">Is he a friend?</label>  
		<input type="checkbox" name="friend" id="friend">
		<input type="submit" id="submit" value="Add"/>
	    <ul id="numbers"></ul>



                  .friend{color: green;}


              # localStorage.clear()
$('#friend').click -> $(this).toggleClass 'checked'

$('#submit').click ->
    ul = $('#numbers')
    number = $('#number').val()
    name = $('#name').val()
    if $('#friend').hasClass 'checked'
    	$(ul).prepend '<li class="friend"><span>Name: ' + name + '<br/> Number: ' + number + '</span></li>' 
    	$(ul).prepend  '<li><span>Name: ' + name + ' <br/>Number: ' + number + '</span></li>' 
    localStorage.setItem 'contacts', $(ul).html() 
    return false

if localStorage.getItem 'contacts'
	$('#numbers').html localStorage.getItem 'contacts'
Loading ..................