I am using Javascript in my php application.I am stuck in one line\this is the line
'<td><input type="button" onClick="$(this).closest('tr').remove();" value="x" class="btn btn-primary"></td>'
I want to concatenate that ('tr') that is present with closest.
There is issue with double quotes and single quote.
Best How To :
You are using single quote within a single quoted string. So you have to escape the quotes with \
echo '<td><input type="button" onClick="$(this).closest(\'tr\').remove();" value="x" class="btn btn-primary"></td>';
for javascript also it is the same
var x = '<td><input type="button" onClick="$(this).closest(\'tr\').remove();" value="x" class="btn btn-primary"></td>';