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.
- <script type="text/javascript">
- $(document).ready(function(){
- $("#checkAll").click(function(){
- $("input").attr("checked", true);
- });
-
- $("#uncheck").click(function(){
- $("input").attr("checked", false);
- });
-
- $("#delete").click(function(){
- $("input:checkbox:checked").remove();
- });
- });
- </script>
- <body>
- <a href="#" id="checkAll">Check All</a>
- <a href="#" id="delete">Delete</a>
- <a href="#" id="uncheck">Uncheck All</a><br/>
- <input type="checkbox"/>My Name is abcdexcv<br/>
- <input type="checkbox"/>My Name is abcdexcv <br/>
- <input type="checkbox"/>My Name is abcdexcv <br/>
- <input type="checkbox"/>My Name is abcdexcv <br/>
- <input type="checkbox"/>My Name is abcdexcv <br/>
- <input type="checkbox"/>My Name is abcdexcv <br/>
- <input type="checkbox"/>My Name is abcdexcv <br/>
- </body>