Skip to content

Instantly share code, notes, and snippets.

@ohararyan
Created July 31, 2014 01:18
Show Gist options
  • Save ohararyan/b8ec873dfe807ba6c695 to your computer and use it in GitHub Desktop.
Save ohararyan/b8ec873dfe807ba6c695 to your computer and use it in GitHub Desktop.

What is $(document).ready(function() {}); ?

How do I select the div.box object in jQuery?

<body>
	<main>
		<div class="container">
			<div class="row">
				<div class="box">
					<h1>Hello World</h1>
				</div>
				<a href="#" class="button">Click me</a>
			</div>
		</div>
	</main>
</body>

How would I hide the above box in jQuery?

How do I create a variable in jQuery?

Write a simple function to change the font colour of the h1 element when I click the button in the above example.

Write another example to show and hide the box after 1 second when you click the button

Run your examples Make sure they work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment