Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

what is fn extend

// The jQuery.fn.extend() method extends the jQuery prototype ($.fn) 
// object to provide new methods that can be chained 
// to the jQuery() function.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery.fn.extend demo</title>
  <style>
  label {
    display: block;
    margin: .5em;
  }
  </style>
  <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
</head>
<body>
 
<label><input type="checkbox" name="foo"> Foo</label>
<label><input type="checkbox" name="bar"> Bar</label>
 
<script>
jQuery.fn.extend({
  check: function() {
    return this.each(function() {
      this.checked = true;
    });
  },
  uncheck: function() {
    return this.each(function() {
      this.checked = false;
    });
  }
});
 
// Use the newly created .check() method
$( "input[type='checkbox']" ).check();
</script>
 
</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Javascript :: copy current filename in emacs 
Javascript :: cara install parrot os di virtualbox 
Javascript :: cd doesn’t work inside childProcess 
Javascript :: prepare webpack-ready 
Javascript :: blue pring GUI react 
Javascript :: The setTimeout() method receives the second parameter in 
Javascript :: inherit mdn 
Javascript :: object with key as individual choice and values as the second choice 
Javascript :: declerative and imperative program combine 
Javascript :: &amp;&amp; in javascript new 
Javascript :: javascript find in array cannot read property of undefined 
Javascript :: class function constructor 
Javascript :: Variable As Parameter In Self Invoking Function 
Javascript :: get react form input using ref react 18 
Javascript :: Function Returning This 
Javascript :: check if a text field is empty javascript 
Javascript :: prisma single data fetch 
Javascript :: javascript asynchronous 
Javascript :: how to Play/start or pause timer in javascript 
Javascript :: javascript reduce mdn 
Javascript :: creating a basic netsuite restlet 
Javascript :: toast.toastAlert ext js 
Javascript :: dropdown list trigger change with value jquery 
Javascript :: concurrently package usage 
Javascript :: cefsharp transparent background 
Javascript :: how to create session cookie in node js 
Javascript :: how to square number in javascript 
Javascript :: fetch devto api with api key 
Javascript :: frompromise rxjs example 
Javascript :: wordpress how to read jquery 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =