views:

213

answers:

3

Is it possible to embed a scrollable text box to output text on my web page, in HTML or JavaScript?

I am trying not to use any Java libraries if possible.

A: 

Since the question is pretty vague i am going to recommend jScroller (since i've used it for some projects)

Ólafur Waage
+1  A: 
    <style type="text/css" media="screen">

 #messages{
  border : solid 2px #ff0000; background : #D5D5D5;  padding : 4px; width : 500px; height : 350px; overflow : auto; 
 }
</style>

    <div id='messages'>
</div>

to scroll down with jquery:

$('#messages').scrollTop( $('#messages')[0].scrollHeight );
Vasil
+4  A: 
<textarea></textarea>
alex
Answer stolen. >_< +1 anyway. (No worries.) ;P
strager
@Strager: Sorry! If it's any consolation I always upvote an excellent strager answer! :)
alex