I have a button , when i click on that button it should change it's text.it's there inside a foreach loop. But the problem is when i click on that button first buttons text change. I want to change the specific button text which i clicked ..How do i do that?
Front-End Part
@foreach($products as $product)
<button onclick="this.disabled=true; quoteAdd('{!!$product->id!!}')" id="inquireButton" class="btn btn-danger ">Inquire</button>
@endforeach
Javascript Part
function quoteAdd(productId)
{
$("#inquireButton").html('Save');
// other code ..
}