Create a jQuery plugin with this pointer - Javascript jQuery

Javascript examples for jQuery:Plugin

Description

Create a jQuery plugin with this pointer

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
 </head> //w  ww .  ja v  a  2  s.  c o m
 <body> 
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> 
  <script>
    (function ($) {
        $.fn.isNot = function (selector) {
            return !this.is(selector);
        };
    })(jQuery);

      </script> 
  <script>
    $(function() {
        $("#result").html( "Not checked: " + $("#result").isNot(":checked") );
    });

      </script> 
  <div id="result"></div>  
 </body>
</html>

Related Tutorials