delete a row when the checkbox is checked and clicked on delete link

delete a row when the checkbox is checked and clicked on delete link

Hi

I want to delete the checked row when i am clicking on delete. For now it just removes the checkbox instead of whole text as well. Please let me know where i am wrong here. 

  1. <script type="text/javascript">
  2. $(document).ready(function(){
  3. $("#checkAll").click(function(){
  4. $("input").attr("checked", true);
  5. });
  6. $("#uncheck").click(function(){
  7. $("input").attr("checked", false);
  8. });
  9. $("#delete").click(function(){
  10. $("input:checkbox:checked").remove();
  11. });
  12. });

  13. </script>



  1. <body>
  2. <a href="#" id="checkAll">Check All</a>
  3. <a href="#" id="delete">Delete</a>
  4. <a href="#" id="uncheck">Uncheck All</a><br/>
  5. <input type="checkbox"/>My Name is abcdexcv<br/>
  6. <input type="checkbox"/>My Name is abcdexcv <br/>
  7. <input type="checkbox"/>My Name is abcdexcv <br/>
  8. <input type="checkbox"/>My Name is abcdexcv <br/>
  9. <input type="checkbox"/>My Name is abcdexcv <br/>
  10. <input type="checkbox"/>My Name is abcdexcv <br/>
  11. <input type="checkbox"/>My Name is abcdexcv <br/>
  12. </body>