What does the keyup() at the end of it mean?
$("input").keyup(function () {
var value = $(this).val();
$("p").text(value);
}).keyup();
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Thanks @nnnnnn Sir.
The code bind a
keyupevent to allinputsalready belong to DOM and immediately trigger it for those inputs.Now,
above code bind the
keyupevent toinputand last.keyup()makes an initial trigger tokeyup.You can rewrite above code also as following:
Does it create an Infinite loop?
NO, It triggers just one time at page load. See here