//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 const gameState = {} function preload() { this.load.image('codey', 'https://s3.amazonaws.com/codecademy-...
-
Answer: From 1 to 9 days
-
$VERBOSE = nil # We'll explain this at the end of the lesson. require 'prime' # This is a module. We'll cover these s...
-
Problem: The Collatz function is defined as f(n) = 3n+1 for odd values of n and f(n) = n/2 for even values of n. What is the smallest poss...
-
class Dog{ int age; public Dog(){ } public static void main(String[] args) { } }
-
//sample solution function isMAC48Address(inputString) { if(inputString.length!=17){ return false; } var regex = /^([0-9A...
-
//Sample solution to main.js var red = [0, 100, 63]; var orange = [40, 100, 60]; var green = [75, 100, 40]; var blue = [196, 77, 55]; ...
-
Question: What does a "dead circuit" in Thevenin's and Norton's theorem mean? Answer: A "dead circuit" means...
-
// Sudoku Solver Project function isPossibleRow(sudoku, row, number) { // This isPossibleRow() function returns true if the 'numbe...
-
$(document).ready(function(){ $("button").on("click", function(){ var message = $("<span>Call 1-555-...
No comments:
Post a Comment