Created
July 1, 2015 08:27
-
-
Save suin/c445b097e9991e65078d 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
$(function(){ | |
$(".checklist").each(function(){ | |
var checklist = $("<div>"); | |
$(this).children("li").each(function(){ | |
var contents = $(this).html(); | |
var item = $("<label>"); | |
$("<input>").attr("type", "checkbox").appendTo(item); | |
item.append(" "); | |
item.append($(this).html()); | |
$("<div>").append(item).appendTo(checklist); | |
}); | |
$(this).replaceWith(checklist); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment