Using .trigger('click') as soon as program is run
<p>In my spelling game there is a grid populated with hidden words. The aim of the game is to spell the words by clicking on the letters of the alphabet with the use of hints like and image and a sound. </p>

<p>The user knows what word to spell by pressing the next button. This button chooses a word in the grid at random and highlights it. My problem is I need the button to be pressed automatically when the game is run so that the user starts straight away.</p>

<p>I have been able to do this by using</p>

<pre><code>    $(document).ready(function(){
    $('.minibutton').trigger('click');
});
</code></pre>

<p>The only problem is I do not know where to add this function and when I do it brakes the normal function of the button which is...</p>

<pre><code>    $('.minibutton').click(function() {

    $('.minibutton').prop('disabled', false);
    $('.picstyle').show();
    $('td').removeClass('spellword');
         var r = rndWord;
         while (r == rndWord) {
         rndWord = Math.floor(Math.random() * (listOfWords.length));
    }

    $('td[data-word="' + listOfWords[rndWord].name + '"]').addClass('spellword');
    $('td[data-word=' + word + ']').removeClass('wordglow').removeClass('wordglow4').removeClass('wordglow3').css('color', 'transparent');

    var noExist = $('td[data-word=' + listOfWords[rndWord].name + ']').hasClass('wordglow2');
    if (noExist) {
        $('.minibutton').click();

    } else {

         $("#mysoundclip").attr('src', listOfWords[rndWord].audio);
         audio.play();
         $("#mypic").attr('src', listOfWords[rndWord].pic);
         pic.show();
    }

 }); 
</code></pre>

<p>Here is a fiddle... <a href="http://jsfiddle.net/smilburn/Dxxmh/34/" rel="nofollow">http://jsfiddle.net/smilburn/Dxxmh/34/</a></p>
