javascript - Using a variable inside document.getElementById -
i'd use php variable instead of #particles
in below given code.
i tried using:
$(" . json_encode($paramnameid) . ").particleground({
but didn't work.
$script = "<script type='text/javascript'> document.addeventlistener('domcontentloaded', function () { particleground(document.getelementbyid('#particles'), { dotcolor: " . json_encode($dotcolor) . ", linecolor: " . json_encode($linecolor) . " }); }, false); </script>";
how can this?
Comments
Post a Comment