jQuery animate example lesson 2

tutoring how to select and animate an element

by Alexus fox

HTML

<div>Click</div>

CSS

div{
  font-size:24px;
    position:absolute;
    display:block;
    padding:10px;
    background:orange;
    width:380px;
    left:0;
}

JavaScript

$(function(){
    $('div').click(function(){
        $('div').animate({
           "left": "100px"
        }, 1000); 
    });
});