Have you considered changing the user of a data attribute for data-key to using var key = $this["context"].nodeName;