Skip to content

Instantly share code, notes, and snippets.

@mannuelf
Forked from anonymous/index.html
Created April 20, 2016 12:11
Show Gist options
  • Save mannuelf/34a6b0296aa58b0c71380974a3e2e31f to your computer and use it in GitHub Desktop.
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
<!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>
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