Textarea height and width in jQuery mobile?

I set the height of the text-area element in jQuery mobile, and I got the perfect height and width in the portrait, but the width does not increase in the landscape. Can someone help me? thanks in advance.

HTML: <textarea cols="55" rows="50" name="textarea" id="newMarkCompleteCommentText" style="background-color:White;width:95%;height: 50px;"></textarea> IN JS: $('#newCommentText').attr('style', 'background-color:White;font-size:18px;height:7em;'); 
+3
source share
2 answers

Try setting "width: auto". Alternatively, instead of β€œ.attr ('style', ...)” you can use β€œ.css ('attribute', 'value')"

 $('#newCommentText').css('background-color', 'white').css('font-size', '18px').css('height', '7em').css('width', 'auto'); 
+2
source

If you set the width and height, you do not need to set the columns and rows. Try deleting these values ​​and the text field should expand with your% values.

Also, your text fields containing a set of elements to expand?

+1
source

Source: https://habr.com/ru/post/955023/


All Articles