MDanz Posted September 19, 2009 Share Posted September 19, 2009 heres what i've done so far <textarea name="reply" cols="118" rows="15" wrap="hard" id="reply" style="color:white; background-image:url($image); border-color:#FBB917" readonly="readonly"> how do i do the function? the hyperlink for the image is $image, which i get from a while loop, how do i display image as textarea background via function? onmouseover=\"ChgText($number)\ <script type='text/javascript'> function ChgText(number){ } </script> Link to comment https://forums.phpfreaks.com/topic/174820-solved-onmouseover-change-background-image-of-texarea/ Share on other sites More sharing options...
MDanz Posted September 20, 2009 Author Share Posted September 20, 2009 i tried this but the background of the textarea turns white <script language="javascript" type="text/javascript"> function ChgText(number) { var newtext = document.getElementById(number).innerHTML document.getElementById('reply').style.backgroundImage = "url(newtext)"; } </script> var newtext = document.getElementById(number).innerHTML this is the hyperlink of the html 'reply' is the value of the textarea.. i want the background image to change to 'newtext' how do i do that? Link to comment https://forums.phpfreaks.com/topic/174820-solved-onmouseover-change-background-image-of-texarea/#findComment-921435 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.