HTML/javascript vertically expand textbox when tex

2019-09-08 06:23发布

问题:

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.