<!-- textarea rows attribute -->
<textarea id="txtid" name="txtname" rows="4" cols="50" maxlength="200">
A nice day is a nice day.
Lao Tseu
</textarea>
//html
<textarea name="text" oninput="auto_grow(this)"></textarea>
//js
<script>
function auto_grow(element) {
element.style.height = "auto";
element.style.height = (element.scrollHeight)+"px";
};
const x = document.querySelector('#textarea-input')
x.onsubmit = (event) => {
messageBox.style.height = 'auto';}
</script>
function autoResize() {
console.log('resizing');
textInput.style.height = (textInput.scrollHeight) + 'px';
}
$('textarea').each(function () {
this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');
}).on('input', function () {
this.style.height = 'auto';
this.style.height = (this.scrollHeight) + 'px';
});
Code Example |
---|
Html :: boostrap card |
Html :: how to align select in table cell center html |
Html :: html table headers |
Html :: h2 in html |
Html :: game engine |
Html :: cards vuetify |
Html :: Disable form first dropdown option |
Html :: barra di ricerca in html |
Html :: html interview |
Html :: random user image url |
Html :: images html |
Html :: input type options html |
Html :: class disabled |
Html :: alpinejs submit prevent default |
Html :: html admin template free |
Html :: bootstrap 4.5 product grid |
Html :: razor view partial view |
Html :: pink color code minecarft |
Html :: iframe |
Html :: androif intent in html link |
Html :: change the height of select option |
Html :: £ in html |
Html :: bootstrap 4 flex |
Html :: how to remove line breaks in html |
Html :: twig last item |
Html :: clickable image html |
Html :: html month set default |
Html :: link to middle of page |
Html :: icon for right arrow |
Html :: include javascript in html |