Skip to content

Instantly share code, notes, and snippets.

@andidp
Created February 17, 2015 09:05
Show Gist options
  • Save andidp/6af0c6aa8e1b6b835630 to your computer and use it in GitHub Desktop.
Save andidp/6af0c6aa8e1b6b835630 to your computer and use it in GitHub Desktop.
jquery click
<html>
<head>
<title>title</title>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script>
$(document).ready(function(){
$('#sel div a').click(function(){
console.log( this.rel );
console.log( this.href );
});
});
</script>
</head>
<body>
<div id="sel">
<div><a href="#{id: 1}" rel="1" id="c1">test</a></div>
<div><a href="#{id: 2}" rel="2" id="c2">tost</a></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment