javascript - Add a class to my element with respect to my textarea height (or rows) -


i have textarea element not have specify height or row..
want add simple class name 1 of elements when textarea element has example 137px height (or example 5 rows).
, when returned default height, class name removed.

you'll ned use javascript/jquery height of element , add or remove class accordingly. example:

if($('textarea').height() == 137) {     $('textarea').addclass('classname'); }else{     $('textarea').removeclass('classname'); } 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -