0

i tried this but the background of the textarea turns white and not to image..

<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 image

'reply' is the value of the textarea.. i want the background image to change to 'newtext'

how do i do that?

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by codejoust
0

i tried this but the background of the textarea turns white and not to image..

<script type="text/javascript">
    function  ChangeText(elementID)
    {  
      var newtext = document.getElementById(elementID).innerHTML;
      document.getElementById('reply').style.backgroundImage = "url("+newtext+")";
    }
    </script>

Reply needs to be the ID of the textarea. I just cleaned up the naming and stuff in the javascript code.

Edited by codejoust: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.