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
Post a Comment