onkeyup event triggers when the user releases a key on the keyboard. Suppose you want to change the background color of the text once the user has entered it in the textbox. You can achieve these types of things via an onkeyup event. Another example of an onkeyup event is the auto-capitalization of letters once any name is written. Here is the syntax for using the onkeyup event
<input type="text" onkeyup="myFunction()">
Thank you @shobhit.kumawat, your comment and explanation helped me and clarified my doubt.