diff --git a/lib/MapboxInspect.js b/lib/MapboxInspect.js
index <HASH>..<HASH> 100644
--- a/lib/MapboxInspect.js
+++ b/lib/MapboxInspect.js
@@ -187,9 +187,17 @@ MapboxInspect.prototype._onMousemove = function (e) {
     if (!features.length) {
       this._popup.remove();
     } else {
-      this._popup.setLngLat(e.lngLat)
-        .setHTML(this.options.renderPopup(features))
-        .addTo(this._map);
+      this._popup.setLngLat(e.lngLat);
+
+      var type = typeof this.options.renderPopup(features);
+
+      if (type === 'string') {
+        this._popup.setHTML(this.options.renderPopup(features));
+      } else {
+        this._popup.setDOMContent(this.options.renderPopup(features));
+      }
+
+      this._popup.addTo(this._map);
     }
   }
 };
Support for htmlNodes (Nodes) in popups