i need some help please i spent forever just searching and trying to know why nothing is happening when i click that button

html:

```
<td></td>
<td></td>
<td></td>
<td><button id="<?php echo($row['ID']); ?>" onClick="delord()" class="del" style="font-size: 12">delete</button></td>

```

jquery:

```
function delord(){
    var x = event.target.id;
    $.ajax({
        url: 'delorder.php?id=' + x,
        success: function(){
            alert('deleted');
        }
    });
}

```

i tried to type `alert(x);` inside my jquery code and it returned the value
then i tried to go to "delorder.php?id=335" and the row has deleted successfully

just when i try it with ajax its not working