Skip to content

Instantly share code, notes, and snippets.

@eamexicano
Created September 4, 2012 15:04
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 eamexicano/3622094 to your computer and use it in GitHub Desktop.
Save eamexicano/3622094 to your computer and use it in GitHub Desktop.
El signo de $ es una abreviación de jQuery
<!-- $ es una abreviación de jQuery. -->
<!-- jQuery en la cabeza -->
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<style>
body {background: #eee; font-family: sans-serif; margin: 0 auto; width: 800px;}
#click {width: 200px; height: 100px; margin: 49% 40%; border: 1px dashed black; background: #eee; line-height: 100px; text-align: center;}
</style>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js'></script>
<script>
jQuery(document).ready(function() {
/*
jQuery('#click').click(function() {
alert('Un mensaje');
});
*/
$('#click').click(function() {
alert('Un mensaje');
});
});
</script>
</head>
<body>
<div id='click'>
Dale click
</div>
</body>
</html>
<!-- jquery en el cuerpo -->
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<style>
body {background: #eee; font-family: sans-serif; margin: 0 auto; width: 800px;}
#click {width: 200px; height: 100px; margin: 49% 40%; border: 1px dashed black; background: #eee; line-height: 100px; text-align: center;}
</style>
</head>
<body>
<div id='click'>
Dale click
</div>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js'></script>
<script>
jQuery(document).ready(function() {
/*
jQuery('#click').click(function() {
alert('Un mensaje');
});
*/
$('#click').click(function() {
alert('Un mensaje');
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment