Access to methods of the plugin, after selecting an element...

Access to methods of the plugin, after selecting an element...


Hello,

I tried to find an answer but can't find it.

So I have a plugin and add it to an element by:

  1. $(":input").tooltip();

Everything works fine.

Now I want to select one of the input fields an call a method of the plugin.

So:

  1. // Select Element (I have the id)
  2. var input = $('#myInput');

  3. // And calling a method
  4. input.myMethod();
But it is not there.

What is my misstake?



The code of the plugin:

  1. $.fn.tooltipo = function(optionen){

  2. // ..... some code

  3.         this.myMethod = function(){
  4.             console.log("Bing");

  5. // ..... some code      
  6.         }
  7. ...


Thank you!