-
-
Save mannuelf/34a6b0296aa58b0c71380974a3e2e31f to your computer and use it in GitHub Desktop.
Move up the chain with end() Moving up the chain with end() // source https://jsbin.com/tenoxaz
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Move up the chain with end()</title> | |
<meta name="description" content="Moving up the chain with end()"> | |
<script src="https://code.jquery.com/jquery-2.1.4.js"></script> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="container"></div> | |
<script id="jsbin-javascript"> | |
var cust = { | |
name: 'Mannuel Ferreira', | |
city: 'Joburg' | |
}; | |
$('<div class="cust"><span /></div>') | |
.find('span') | |
.attr('title', cust.name) | |
.data(cust) | |
.html(cust.name) | |
.end() | |
.appendTo('#container'); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var cust = { | |
name: 'Mannuel Ferreira', | |
city: 'Joburg' | |
}; | |
$('<div class="cust"><span /></div>') | |
.find('span') | |
.attr('title', cust.name) | |
.data(cust) | |
.html(cust.name) | |
.end() | |
.appendTo('#container');</script></body> | |
</html> |
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
var cust = { | |
name: 'Mannuel Ferreira', | |
city: 'Joburg' | |
}; | |
$('<div class="cust"><span /></div>') | |
.find('span') | |
.attr('title', cust.name) | |
.data(cust) | |
.html(cust.name) | |
.end() | |
.appendTo('#container'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment