Log in

View Full Version : is it possible to add or input image in textarea?



rhodarose
08-09-2010, 05:01 AM
Good day!

I creating a news webpage and my news has a image and text. i want to use a text area so that only the news would bew scroll not the whole webpage...I don't know how can i add images in a textarea...

I hope you can help me..

Thank you

jscheuer1
08-09-2010, 05:25 AM
Nope. No images allowed in textarea. You could use a division (<div>). Instead of setting its value though, you could set its innerHTML property.

rhodarose
08-09-2010, 06:39 AM
how can i use <div> in adding images?

Beverleyh
08-09-2010, 07:52 AM
Try wrapping your textarea in the div tags and add a background image to the div, then make the textarea transparent so the image from the div shows through.

jscheuer1
08-09-2010, 01:26 PM
how can i use <div> in adding images?

Well, that depends upon what you are doing. I'm imagining that you have a textarea. After that, I'm not sure. How are you getting the text into the textarea? You could be doing it with javascript, or via server-side code. It might even be something I'm not thinking of. Which is it?

Anyways, the options for a division are the same two I mentioned, either javascript or server side code.

If you were using javascript, you should have been using the textarea's value property to set the text in it. With a division you can use its innerHTML property to set text and even an image or other HTML tags for it.

If using server side code, things work pretty much the same with a div, as with a textarea.

To best advise you on how to proceed, I would need to know what you are currently doing to get the text into the textarea. And it would help to see your code or have a link to your page.