Answer the question
In order to leave comments, you need to log in
How to use the onclick event?
There is a block: It is
necessary that by clicking on this .z1 block, a click on the block with the .z2 class also fires.
How to write onclick correctly?
Thanks <div class="z1" onclick="">открыть</div>
Answer the question
In order to leave comments, you need to log in
I think you want weird.
The telepath on duty isn't back from vacation yet, but I'll try to guess: jsfiddle.net/3qrakLsz
The question is not entirely clear: what does it mean "a click on a block with the class z2 worked"?
What should the result of the function be?
easiest way with jquery:
$('.z1').click(function(){
$('.z2').click();
});
document.querySelector(".z1").onclick = function(){
document.querySelector(".z2").click();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question