jquery - HTML - Break line in a pre tag -
i trying copy (with jquery , js) text written in textarea pre tag. however, cannot introduce many line breaks want. instance, if press enter once, works , create line break, if press enter more once cannot more 1 line break. know why happens, or how can fix it?
the code goes pretty this:
<textarea id="area" rows="5" cols="30"> </textarea> <pre id="area2" > </pre> <br/> <script> newtext = $( '#area' ).val(); $( '#pre' ).text( newtext); </script>`
the id of textarea #area , id of pre tag #pre
i had problem ie7. doesn't display more 1 newline within pre tag.
Comments
Post a Comment