Change Font Size dynamically based on Character count
问题 I'm trying to adjust title sizes depending on character length. (wordpress) This is what I have so far. It doesn't return any error but it doesn't work. jQuery(function ($) { $(window).load(function () { var textLength = $('.autotitle').val().length; if (textLength < 20) { // Do noting } else if (textLength > 20) { $('.autotitle').css('font-size', '16px'); } }); }); 回答1: Many times one would like to decrease font size (make it smaller) when text is long based on letter count (text might have