开发者

How do i update this textarea plugin with .live()?

i've been working on this for more than hours and hours and i cant figure it out. I've downloaded this textarea expansion plug in over here http://www.sitepoint.com/blogs/2009/07/29/build-auto-expanding-textarea-1/ and it works. But i am creating a dynamic page that adds textareas after the document is ready and i cant find a way to modify the plug-in so that it will apply to fut开发者_StackOverflow社区ure textareas. I am fairly new to jQuery but i really need help. Thank you so much!

Also, on a sidenote, i had some trouble with the textareas themselves. How do i make it so that the textarea is able to interpret line breaks when the user hits enter/return. So far it just parses out the text as a single string with no breaks. For jQuery, i was basically taking the value of the textboxt with .val() and placing on a paragraph somewhere. That paragraph happens to be only a single line with no line breaks. Any ideas?


Take a look at this...

http://jsfiddle.net/QrKuF/1/

Matt is correct.


For your second question, it's because textarea stores new line character but html wont understand it. If you want to set new lines in your div, you can replace the new line characters with br tag.

example here http://jsfiddle.net/jkhnV/2/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜