May I know how to pass a varchar parameter to an onClick function, the varchar parameter is the uuid that stored in my database table and i use mysqli_fetch_array to retrieve them. A list of items will display in my html and each item is assigned with the button, when the button is pressed , it will display the uuid of the particular item in the alert window. I am able to that when the id is numeric or integer, but when I change it into the uuid or md5 id or the string, the value is failed to pass, and the button is stuck. Here is some part of my code.
<button type="button" class="btn btn-outline btn-danger"
onClick="deletefun(<?php echo $row["id"]; ?>)"
title="Delete">delete</button>
When the deletefun button is pressed, the alert window will pop out to display the uuid of the particular item in the list.
<script>function deletefun(data){
alert(data);
</script>
Thank you for helping.