XMLSerializer() - converting a DOM element into a String


#1

I trying to track which elements a user clicks on.
For this I’m converting the event target into a string and saving this string in a collection.

To convert the targeted element into a string I’m using XMLSerializer().
(https://developer.mozilla.org/en-US/docs/Web/API/XMLSerializer)

The problem is that older browsers do not support this.

Do you guys know of any other method to convert a DOM element into a string?

my code:

event(e, t)

   var s = new XMLSerializer();
   var target = s.serializeToString(e.target); // convert to String
   UserTracks.insert({user: Meteor.userId(), registered: true, route: route, target: target});
```

cheers
Godo