Can you please tell me how can I set the test function for the keyup element inside the test() function; What would be only the function call in document ready, and all other events in the function itself.
jQuery.fn.extend({
test: function() {
$(this).val("123");
}
$(this).test();
$(this).keyup(function() {
$(this).test();
});
});
$(document).ready(function() {
$("input").test();
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="text" value="456">