0

As title, can I add a custom function in pepper plugin API?

Can the custom function return a value?

like this

HelloTutorialModule = document.getElementById('hello_tutorial');
var errorCode;
errorCode = HelloTutorialModule.myCustomFunction('Hello');

Thanks

PTTjanice001
  • 43
  • 1
  • 11

1 Answers1

-1

yes, you can, because document.getElementById will return an Object, you can enhance this object if it is not freeze.

Please refer to my DEMO

Jesse
  • 517
  • 5
  • 24
  • Object of JS is open, you can override or add code of any Object expect of frozen Object. – Jesse Dec 26 '14 at 06:12