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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.