This example demonstrates an alert trigger when the input value width or cursor crosses the input width. How can we retrieve the width of the input value without just getting the length of the value in jQuery?
$('.value_width').text($('.input').val().length); //this is just length of value but not value width
$('.input_width').text($('.input').width());
$('.input').keyup(function(){
$('.value_width').text($(this).val().length); //this is just length of value but not value width
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" class="input" name="" value="Example Text" />
<p/>
Value width : <span class="value_width"></span>
<br>
Input width : <span class="input_width"></span>