jeudi 26 mai 2016

How to pass value on onclick function in laravel

I want to send a value to a javascript function when a button is clicked. The value comes from the database. How can I do it using laravel blade?

Here is my HTML code:

<a  href="" onclick="add($res->driver_id);"><i class="fa fa-pencil-square-o"></i></a> 

and my javascript:

<script>
function add(var id)
{
    alert(id);
}
</script>



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1UfmfNY
via IFTTT

Aucun commentaire:

Enregistrer un commentaire