Html
Example
<html>
<!-- heading -->
<head>
<meta charset="utf-8">
<title>Example</title>
</head>
<!-- page -->
<body>
<!-- connect the library jQuery -->
<script src="https://dir.by/example_lib/jquery/jquery-3.3.1.min.js"></script>
<!-- HTML Elements -->
<form id='myform'>
<input type='input' value=''>
<BR>
<input type='input' value=''>
</form>
<input type='input' value=''>
<script>
// Let's add a function clearForm for all objects jQuery
jQuery.fn.clearForm = function() {
return this.find( ":input" ).each(function() {
this.value = "Hello!";
}).end();
};
// function clearForm works for all objects jQuery
// because a new method is added to prototype
// jQuery.fn === jQuery.prototype
// find our form and call a new function clearForm()
// function clearForm Sets value="Hello!"
// for all elements of the form input in which we call clearForm
var form1 = $("#myform");
form1.clearForm();
</script>
</body>
</html>