Created
September 29, 2014 17:47
-
-
Save ryanorsinger/44d2e378b355001fe01f to your computer and use it in GitHub Desktop.
jQuery selectors - id, class, and element selectors. Method chainingl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Exampe jQuery Page</title> | |
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script> | |
</head> | |
<body> | |
<h1 id="codeup">Hello Codeup</h1> | |
<ul class="codeup"> | |
<li>$ is an alias of `jQuery` to reference the jQuery object.</li> | |
<li>JS natively has `window.onload = function() { console.log('The page has finished loading');`</li> | |
<li>$(document).ready(function() { console.log( 'The DOM has finished loading!' ); });`</li> | |
</ul> | |
<script> | |
$('document').ready(function() { | |
var contents = $('#codeup').html(); | |
alert('The html of the id 'codeup' is ' + contents); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment