Created
April 20, 2016 12:10
-
-
Save anonymous/30c2fd30e9e2ebed61058d0d8660f70c 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