how to manipulate input element and more

by Akram kamal

HTML

<div id="one">
    <input type="checkbox" name="first" value="Jide" />
    <input type="checkbox" name="first" value="Tom" />
    <input type="checkbox" name="first" value="Fem" />
    <input type="checkbox" name="first" value="Weng" />
</div>
<div id="two">
    <ul></ul>
</div>

JavaScript

$("[name='first']").change(function () {
    var lis = ""

    $("[name='first']:checked").each(function () {
        lis += "<li>" + $(this).val() + "</li>"
        console.log(this)
    })
    console.log(lis)
    $("#two ul").html(lis)
})