How to define my own js function in jsfiddle?

I want to check how my own update function works on jsfiddle , but when I click the button, I get an error message that is being updated undefined.

How can I use my own functions in jsfiddle?

+6
source share
1 answer

Two problems:

The first problem is that you have extra text at the end of the script:

 })(); 

The second problem is that you are completing function definitions inside the onDomReady function.

Change this option to no wrap(head) and it will work.

+9
source

Source: https://habr.com/ru/post/896096/


All Articles