//Sample Solution for script.js $('document').ready(function() { $('#changeButton').click(function() { //create a new div with id 'new-div' $newDiv = $(''); //code to insert the element into the page. //you'll learn this next section! //(and a little at the end of this one) $newDiv.html("I'm the new div"); $('body').append($newDiv); }); });
Quotes help make search much faster. Example: "Practice Makes Perfect"
Thursday, November 8, 2012
Codecademy: Sample Solution to "In the beginning..." under the jQuery track
//Sample Solution for script.js $('document').ready(function() { $('#changeButton').click(function() { //create a new div with id 'new-div' $newDiv = $(''); //code to insert the element into the page. //you'll learn this next section! //(and a little at the end of this one) $newDiv.html("I'm the new div"); $('body').append($newDiv); }); });
Labels:
Codecademy,
jQuery
Subscribe to:
Post Comments (Atom)
This is an example of scrolling text using Javascript.
Popular Posts
-
//sample solution // Here is the array we will store results in var multiples = []; function multiplesOf(base, i) { // Base case ...
-
class Dog{ int age; public Dog(int dogsAge){ age = dogsAge; } public void bark() { System.out.println("Woof...
-
#sample solution def factorial(x): x = abs(x) #prevents error on negative numbers product = 1 for i in range(x): product = prod...
-
//Sample Solution const gameState = {} function preload() { this.load.image('codey', 'https://s3.amazonaws.com/codecademy-...
-
// Sample Solution using System; namespace ComparisonOperators { class Program { static void Main(string[] args) { ...
-
#sample solution def run(bottle): #your code here bottle.drink(250) bottle.refill(150) return bottle.amount_left cl...
-
<!-- sample solutions to Welcome to HTML! --> <h1>Bruce Wayne</h1> <!-- sample solutions to Speak in Paragraphs --> ...
-
//sample solution function isCaseInsensitivePalindrome(inputString) { var temp = inputString.toLowerCase(); var tempReversed = te...
-
A regular polygon has sides of equal length. Type in the length of the side of a sided regular polygon: meters Compute
-
/*sample solution to style.css*/ /*code exists prior to this point*/ #logo{ font-family: Georgia; /*added code*/ width: 35%;...
No comments:
Post a Comment