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>

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.