jquery functions -


i'm trying write own function no luck. "...is not function"

jquery.fn.extend ({ myfirstfunction : function () { alert ("first function") } });  <script type="text/javascript">     $(function(){                          $.myfirstfunction();     }); </script> 

$.myfirstfunction = function () { alert ("first function") };  <script type="text/javascript"> $(function(){                      $.myfirstfunction(); }); </script> 

http://jsfiddle.net/mdqw6/

or

jquery.fn.extend ({   myfirstfunction : function () { alert ("first function") } });  <script type="text/javascript">     $(function(){                          $(element).myfirstfunction();     }); </script> 

read more @ http://docs.jquery.com/plugins/authoring


Comments