We can use a check to see what values the input has at keyboard events. Then if it has empty string we can simply restore the original font-size of the mentioned classes.
font-size
Here is an approach to do so:
$(function() { $(".checker").on("keydown keyup", function(ev) { $(".js-cool, .js-beans").css("font-size", "24px"); $input_val = $(this).val(); if ($input_val == "") { $(".js-cool, .js-beans").css("font-size", "inherit"); } }); });
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
We can use a check to see what values the input has at keyboard events. Then if it has empty string we can simply restore the original
font-size
of the mentioned classes.Here is an approach to do so: