Javascript code for add/remove tags.