OBV
OBV

Reputation: 1259

<textbox> in HTML that applies markup? Alternatives?

I am doing an AJAX request and entering the response to a textbox as I like it's behavior (slide scroll, adjustable).

If the response has markup and I want this interpreted, should I use a div and apply textbox-like attributes via CSS? Or is there a way to get textbox tag to interpret markup?

Got the feeling this may be a really thick question, so sorry if so!

Upvotes: 0

Views: 192

Answers (2)

Hasib Mahmud
Hasib Mahmud

Reputation: 786

You can put your response in a div and the div could be like the following:

<style>
.scroll{overflow:scroll;width:100px;}
</style> 
<div class="scroll">
 Your response
</div>

or you can use overflow:auto

<style>
.auto{overflow:auto;width:100px;}
</style> 
<div class="auto">
 Your response
</div>

Upvotes: 1

Fauxsaurus
Fauxsaurus

Reputation: 520

A div like textbox is your best bet. There is currently no easy way to interpret markup with a textarea. If you want you could possibly overlay a div with a transparent textarea to allow for easier input.

Upvotes: 0

Related Questions