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

Java 8 + Maven Javadoc plugin: Error fetching URL -

android - How to delete or change the searchview icon inside the SearchView actionBar? -

c++ - Msgpack packing bools bug -