intro should be sent to the function as a string, not a variable, i.e. 'intro'
In addition, you should rename your function, for example removeById instead of remove . Then it works great.
The remove function actually does something completely different. (Your function is not even called when it is called remove , as you can see by putting a warning message in it.)
function removeById(id) {
source share