HTML/javascript vertically expand textbox when text is too long

一笑奈何 提交于 2019-12-25 14:01:03

问题


I wish the containing element (either a or element) to automatically expand vertically to accommodate text that has reach the end of line. Is there a way to do this with plain HTML elements? If not, can I do this using javascript?

Thanks.


回答1:


Sorry, but there is no way to this in plain HTML. With Javascript it's possible though.

Take a look at jQuery plugin: autoResize. Note: this is a plugin for jQuery.

Also, see this thread for more jQuery alternatives.



来源:https://stackoverflow.com/questions/8809568/html-javascript-vertically-expand-textbox-when-text-is-too-long

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!