//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
-
Answer: Alt - p p stands for previous. If you keep pressing Alt - p, you will continue cycling back through commands you typed before. I...
-
#sample solution hungry = false unless hungry puts "I'm writing Ruby programs!" else puts "Time to eat!...
-
//sample solution def isEven(x): if(x % 2 == 0): return "yep" else: return "nope"
-
//sample solution var yourName = "Pam"; var gender = "female"; var result; //Line 10 starts an if statement //Ne...
-
<!-- Sample solution to index.html --> <!DOCTYPE html> <html> <body> <div class="nav"> ...
-
<!--sample solution--> <html> <head> <title>Week 13 Project</title> </head> ...
-
# Test equality test_company = 'apple' print(company_1 == test_company) # Compare revenue_1 and revenue_2 print(revenue_1 ...
-
favorite_animal ||= "dog" favorite_animal ||= "cat"
-
class Computer @@users = {} def Computer.get_users return @@users end def initialize(username, password) @username = usern...
-
#Sample Solution --- title: "Joining Tables in R" output: html_notebook --- ```{r message = FALSE} # load packages library...
No comments:
Post a Comment