// Move an item up $('.up').click(function(){ var thisItem = $(this).parent().parent(); if(thisItem.prev().is('div')){ thisItem.prev().before(thisItem); } });