Reputation: 1365
I would like to make a different behavior for a textarea if textarea has more than one line worth of text.
However, by default, if I make a textarea, text area has enough height for 2 rows to begin with even without any contents.
I do not want that.
How can I check to see if I have single line in a textarea or not with javascript?
Upvotes: 0
Views: 942
Reputation: 139
jQuery: $("#myTextarea").rows
vanilla JS: document.getElementById("myTextarea").rows
Upvotes: 1