how save hidden courses in variable removeid

how save hidden courses in variable removeid

I need when click on remove button hidden the courses removed then save in variable name removeid
removeid will have courses be hidden when remove 
as example below
my code as following in fiddle
suppose i have courses
Id  CourseName
1   c#              removebutton
2  asp.net        removebutton
3 javascript     removebutton
suppose i remove 2,3 that represent asp.net and javascript
then removeid variable will have value 2,3 after click remove courses and be hidden