Autoclick only in class within class

Asked

Viewed 47 times

2

I would like to perform a sequenced Autoclick on only one link at a time and only on class="mobile" that has a class="check-Handler". Thanks to those who help me because I’ve tried several scripts but so far nothing.

(A)<div class="clicked mobile" id="container">
   <div class="check-handler" data-id="000" data-url="http://www.xxx.com">    

(B)<div class="mobile" id="container">                                   
   <div class="check-handler" data-id="111" data-url="http://www.mmm.com">

(C)<div class="mobile" id="container">                                   
   <div class="check-handler" data-id="222" data-url="http://www.uuu.com">

if ($('.mobile #container .check-handler').is(':visible')) 
    setTimeout(function(){$('.mobile #container .check-handler').click();},5000);
  • Could explain better?

  • On the page there are several blocks but I need an Autoclick only on the blocks equal to option "B". My thought is: It would be possible to create code that works Autoclick only if class=x is below class=y?

1 answer

1


I got the answer through another Javascript site.

$(document).ready(

function() {

setTimeout(
function () {

$('#container:not(.clicked.mobile) .check-handler').click();


}, 3000);}); 

Browser other questions tagged

You are not signed in. Login or sign up in order to post.