Ask your JavaScript questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

delete a li item in a ul (#sortable_1). JavaScript

  • REFUNDED

I need a function associated with a button to delete a li item in a ul (#sortable_1). The website is https://verlager.com/pairing.php?box=26

HTML:

<div>
<img src = "images/minus_button.webp" onclick = "delEntrant();" alt="delete" title = "click to delete a player" />

<or a button would be better)
</div>

USAGE:

1. user clicks on button image.

2. cursor style changes to cursor: not-allowed

3. alert pops up alert("click entrant to delete");

4. if user clicks over <li> item within ul #sortable_1 then:
delete the li item under the cursor

5. change the cursor back to hand

<script>
function delEntrant() {
$("#sortable_1 li").click(function (e) {

if (confirm("DELETE this player ?")) {

$(this).remove();

}
});


}
</script>

Answers (0)

No answers yet.