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

Thursday, November 8, 2012

Codecademy: Sample Solution to "Implicit Element Creation" under the jQuery track


//Sample Solution for script.js $('document').ready(function() { $('#changeButton').click(function() { //create a h1 with the class 'greeting' //inside of the div with id 'header' //(the message can be anything, or nothing, although thats lame) $myHeader = $('#header'); $myHeader.html('

Nothing

'); //create a div with the text contents //'inner-div' //inside of the div with id 'outer-div' $myDiv = $('#outer-div'); $myDiv.html('
inner-div
'); $('body').append($myHeader); $('body').append($myDiv); }); });

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts