jquery - How To Get Input Value That Saved Before -


i have following function:

$(function () {     $('#phone-number').keyup(function(){         var pnumber=$(this).val();         $('.phone-number').text(pnumber)     }); }); 

i can value after keyup event have problem value saved in input text when user double clicks on input. way #phone-number input type text , .phone-number div

$('#phone-number').val('78908'); $('#phone-number').on("keyup change", function () {     var pnumber = $(this).val();     $('.phone-number').text(pnumber) }); $('#phone-number').change(); 

demo

are looking this?i added initial value called change event manually mean?no need double click input box because no 1 double clicks input text user type in input text


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -