Jump to content

[SOLVED] onmouseover change background-image of texarea


MDanz

Recommended Posts

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>

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.