엄지월드

jQuery remove 본문

카테고리 없음

jQuery remove

킨글 2017. 7. 15. 14:24
반응형


<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>


<ul id=""> 

  <li><input type="text" value="aaa"><input type ="button" name="" value = "Clear1"/></li> 

  <li><input type ="button" name="" value = "Clear2"/></li>

  <li><input type ="button" name="" value = "Clear3"/></li>

</ul>


<script>

$("input[type=button]").click(function() { 

   $(this).parent().remove();

})

</script>   

출처 : https://stackoverflow.com/questions/2234916/remove-li-based-on-button-click


Comments