Skip to content

Instantly share code, notes, and snippets.

@doubleo2
Created February 5, 2017 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doubleo2/8417f540416fae21cedceeec2d069293 to your computer and use it in GitHub Desktop.
Save doubleo2/8417f540416fae21cedceeec2d069293 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=8417f540416fae21cedceeec2d069293
<!DOCTYPE html>
<html>
<head>
<title>Welcome To Javascript Variables</title>
</head>
<body>
<h1>Welcome to Javascript</h1>
<button>CLICK ME</button>
<p></p>
</body>
</html>
{"enabledLibraries":["jquery"]}
/*
Directions:
1. Click the "Click Me" button
2. Change the Javascript code below to say that you are the greatest after you click the button.
*/
// Who is the greatest? Remember to use "quotation marks"!
var name;
name = "ScriptEd";
// When button gets clicked, change some HTML
$("button").click( function(){
$("p").html(name + " IS THE GREATEST WOOOOOOOHHHH!!111!");
});
body {
text-align: center;
}
button {
font-size: 50px;
padding: 20px;
}
p {
font-size: 30px;
color: green;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment