How do I add data attributes to a script using the HTML builder

Ah yeah. The only documentation we reference that I can find is virtual-dom/virtual-hyperscript/README.md at master · Matt-Esch/virtual-dom · GitHub and it’s sort of hidden in our codebase as a comment :slightly_smiling_face: Even with that I couldn’t find the answer you are looking for there. In any case, there is a topic here on Meta that does have the solution:

So based on the code you provided, it should work if you change it to the following:

h("script", { src: "http://localhost:5000/pass.js", attributes: { "data-space": "123" } }),
8 Likes