This question has already been answered:

Hello. There is a code:

document.getElementsByClassName('.slide-225').onclick = function() { var timer_metaslider_206 = function() { var slider = !window.jQuery ? window.setTimeout(timer_metaslider_206, 100) : !jQuery.isReady ? window.setTimeout(timer_metaslider_206, 1) : metaslider_206(window.jQuery); }; timer_metaslider_206(); }; 

You need to bind the click to the timer on the class, but the script does not work and does not output an error to the console. Please tell me what is the error?

Reported as a duplicate at Grundy. javascript Jan 29 '17 at 16:18 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

    2 answers 2

    Added EventListener to catch click.

      document.getElementsByClassName('slides')[0].addEventListener("click", function(){ $('.flex-next').flexslider("next"); }) 
    • Why not describe in the answer what has changed and why? - Alexey Shimansky
    • Alas, nothing has changed and the console did not display an error. - Webdev96
    • I did not have time, right now I will add - L. Vadim
    • @ Webdev96 timer_metaslider_206 what's this? - L. Vadim
    • timer_metaslider_206 is a variable that I declared for the timer. Alas, adding EventListener did not help. - Webdev96

    So it will not work ?:

     $('.class').click(function(){ setTimeout(timer,2000); }); function timer(){ } 
    • I'm going to try now. Unsubscribe if it helps - Webdev96
    • No, alas, it did not help ( - Webdev96