I'm trying to implement a simple jquery code, One function that will add new rows to a table:
function add_row(){
$('#giants_table tr:last').before('<tr><td><input type="text" name="giants_#" id="giants_#"><input type="button" id="removebtn" value="Remove row" onclick="remove_row()"</td></tr>')}
And the second function to remove that row:
function remove_row(){
$(this).parents('tr').remove()}
The first function works just fine, but it appears that in the second function the "this" selector is not set.
Any ideas?