Quotes help make search much faster. Example: "Practice Makes Perfect"

Thursday, November 8, 2012

Codecademy: Sample Solution for "Changing the Subject - again"


//Sample Solution for script.js

$('document').ready(function() {
$('#changeButton').click(function() {

var $divToInsertAround = $('#insertHere');

//Insert a div with content 'before' and class 'before'
//before $divToInsertAround using .before
$divToInsertAround.before('<div class="before">before</div>');

//Insert a div with content 'after' and class 'after'
//to $divToInsertAround using .after
$divToInsertAround.after('<div class="after">after</div>');

});
});

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts