Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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