Here is a way you can do something like this. It's not entirely clear what you're looking to accomplish, so I took some guesses.
Working Example: https://jsfiddle.net/Twisty/tre7dx8a/
Added add as a class for each button in HTML.
JavaScript
$(function() {
var Movies = [];
$(".btn.btn-outline-success").click(function(e) {
if ($(this).hasClass("add")) {
var row = $(this).closest("tr");
var movie = {};
movie.id = row.find("td:eq(0)").html();
movie.title = row.find("td:eq(1)").html();
movie.year = row.find("td:eq(2)").html();
movie.type = row.find("td:eq(3)").html();
Movies.push(movie);
console.log("Added Movie:", movie);
$(this).html("Remove").toggleClass("add remove");
} else {
var id = $(this).closest("tr").find("td:eq(0)").html();
var index = -1;
$.each(Movies, function(k, v) {
if (v.id == id) {
index = k;
}
});
if (index > -1) {
Movies.splice(index, 1);
console.log("Removed Movie:", id);
$(this).html("Add").toggleClass("add remove");
}
}
});
});
When Add is clicked, a movie object is created and populated with the items from the <td> in that <tr>. I used the :eq() selector to specifically identify each element. I then used .html() to read the content of the element. I could have also used .text().
I then considered that the user may make a mistake or change their mind, so I set the button to toggle itself to a Remove. This has a similar action, but will find and remove the movie from the storage array.
You can move them to local storage in a similar manner. Might be worthwhile writing a function to send the data back and forth to/from local storage.
Output, so that does not make much sense. What do you want to have happen when you click the button?