I have got a .js file that adds functionality to a menu when the page loads (when document is ready) ... the first three lines of the file are...
( function( $ ) {
$( document ).ready(function () {
$('#cssmenul li.has-sub>a').on('click', function(){
After that there's loads more code that adds colours and other visual effects.
At the moment the function doesn't have a name - it just runs. However if I wanted to call the function from a button how do I name it? If called the function activateMenu I would then have a button like this:
<input type="button" value="Activate" onclick="activateMenu();">
Thanks very much