MDanz Posted November 18, 2009 Share Posted November 18, 2009 echo "<div style='display:none;' name='advertisement'>$image </div>"; <a href='$adz' style='text-decoration: none'; onmouseover=\"GetNames($id)\">$usern</a> <script type="text/javascript"> function GetNames(id) { var newtext2 = document.getElementByName("advertisement").innerHTML; document.getElementById('adver').style.backgroundImage = "url("+newtext2+")"; } </script> <textarea name="adver" id="adver" cols="16" rows="13" readonly="readonly" ></textarea> the $image should appear in the text area, where did i go wrong in my code? Link to comment https://forums.phpfreaks.com/topic/181944-help-with-onmouse/ Share on other sites More sharing options...
KevinM1 Posted November 18, 2009 Share Posted November 18, 2009 Without seeing where $id comes from or what element has an id of 'advertisement', I'm guessing it has something to do with you never actually using the id you pass to the event handler. Link to comment https://forums.phpfreaks.com/topic/181944-help-with-onmouse/#findComment-959782 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.