Access element tag name appropriately

This fixes #146, which was introduced in be269e1.

elem is already the DOM element so we don't need to fetch "context" first.