I'm creating new element with createElement
function. It works fine. However, I started to use some external SDK, where I need to setup param-bad
parameter for some elements. But it doesn't work.
Code:
var element = document.createElement("div");
element.param_good = "value";
element.param-bad = "value";
While I try to add param-bad
with some value, I get an error:
Uncaught SyntaxError: Invalid left-hand side in assignment
Also, param_good
of course works fine.
How do I work around this?