With php it’s easy to do something like this
<?
$x = "Joe";
echo "My name is $x";
?>
But I’m having trouble doing something similar with javascript
var div = document.createElement("DIV");
x="SomeValue";
div.setAttribute("id", (x));
div.setAttribute("onMouseDown", "SomeFunction((x))");
where obviously I want x to be “SomeValue”, but every time I look at the output, it just says x instead of the value.
Change…
to…
JavaScript doesn’t support string interpolation of variables.