When you type something into the input I want it to always add " h" at the end (h - hours). When you enter "21", the input value should be "21 h". When you enter "37", the input value should be "37 h", etc.
<input type="text" class="input">
$(".input").on('input', function(){
let input = $(this).val();
$(this).val(input + " h");
})
The code above gives "2 h1 h" when you enter "21". How can I add " h" at the end of the whole value instead of adding it to every entered character?
(I can't add <p>
tag after the input)