change class of li on click of input

change class of li on click of input

Hi I have an input inside an li
<ul class="action">
                                    <li class="warning">
                                        <label for="ESig" class="tall">Name</label>
                                        <input name="ESig" type="text" class="swap_value" id="sig" value="Electronic Signature Required" />
                                    </li>
</ul>

when you click inside the input #sig, I need the parent li's class to change from "warning" to ".thanks" (they have different bg images)
for some reason this isn't working

<script type="text/javascript">
$("#sig").click(function() {
      $(this).parent li().removeClass("warning").addClass("thanks");
});
</script>