Get tag name and save it on a variable

Welcome to the forum, Daniel.
Please have a read of Wiki - how to post code on this forum and then hit the pencil icon below your post to edit and fix the code formatting. Thanks.