$(document).ready(function(){ $(document).bind('elliott_poll_vote_event',function(e){ var imageDiv = $("div.live-vote-slice"); var imgTag = document.createElement('img'); imgTag .setAttribute('border',"0"); imgTag .setAttribute('height',"1"); imgTag .setAttribute('width',"1"); imgTag .setAttribute ('src',"http://amch.questionmarket.com/adsc/d988176/7/989457/adscout.php?ord=[randnum]"); imageDiv .appendChild(imgTag); }); });