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

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -