tag list
by sambaldwin
HTML
<ul>
<li>architecture</li>
<li>collaboration</li>
<li>Website design</li>
<li>Website development</li>
<li>WordPress</li>
</ul>
CSS
* {
margin:0;
padding:0;
}
body {
font-family:Helvetica Neue;
font-weight:500;
margin:1em;
}
ul {
list-style-type:none;
margin:0 0 0 2em;
}
li {
cursor:pointer;
}
li:hover {
color:red;
}
JavaScript
$('li').hover(
function() {
var $this = $(this); // caching $(this)
$this.data('initialText', $this.text());
$this.prepend("#");
},
function() {
var $this = $(this); // caching $(this)
$this.text($this.data('initialText'));
}
);