javascript - $(...).functionName() is not a function - Why it occurs and how to avoid this? -


i getting console error

$(...).functionname() not function


this function call

$("button").functionname(); 


function

$.fn.functionname = function() {        //do }(jquery); 


why error comes , how avoid error?

try using following syntax:

jquery.fn.extend({     functionname: function () {      } }); 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -