Created
November 18, 2015 18:44
-
-
Save nonZero/8ea81f2aaeeb3f73220b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<table id="mytable" border="1"> | |
<tr> | |
<td>1</td> | |
<td>1</td> | |
<td>1</td> | |
<td>1</td> | |
</tr> | |
<tr> | |
<td>1</td> | |
<td>1</td> | |
<td>1</td> | |
<td>1</td> | |
</tr> | |
</table> | |
<p id="add">ADD</p> | |
<ul id="foo"> | |
<li>1</li> | |
<li>2</li> | |
<li>3</li> | |
<li>4</li> | |
</ul> | |
<ul id="bar"> | |
<li>1</li> | |
<li>2</li> | |
<li>3</li> | |
<li>4</li> | |
</ul> | |
<script src="jquery-2.1.4.js"></script> | |
<script src="stuff.js"></script> |
This file contains hidden or 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
"use strict"; | |
console.log("start"); | |
$("#add").click(function () { | |
$("#foo").append($("<li>0</li>")); | |
}); | |
$("#foo li").click(function () { | |
console.log(this); | |
// $(this).text(Number($(this).text()) + 1); | |
$("#bar").append($(this).detach()); | |
}); | |
console.log("end"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment