Super Simple jQuery Plugin Example

<script src="jquery.js"></script>

<script>

   (function($){
   
    $.fn.setValue = function(options) {
var self = this;
var opts = $.extend( {}, $.fn.defaults, options );
self.val(opts.n);
return this;
}
   $.fn.defaults = {
    n: "This is Defult"
   }
   
   }(jQuery))


$().ready(function() {
$("#mText").setValue({n: "This is my Value"});
})
</script>


<input type="text" value="Allah Sukar" id="mText" />
Posted by:

No comments posted.

Name :  

Email :  

Comment Below