C
C
Conan the Barbarian2018-03-02 13:21:42
css
Conan the Barbarian, 2018-03-02 13:21:42

How NOT to execute js on click on a certain element?

Hello.
I have two blocks (.wrapper and .other-wrapper). By clicking on .wrapper, I should have .other-wrapper appear.
Question: I have a link in the .wrapper block, how can I make it so that by clicking on it .other-wrapper does NOT appear, but performs its direct functions of the link.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tyzberd, 2018-03-02
@JaredWinter

https://jsfiddle.net/5ohkwtno/4/

P
po5epT, 2018-03-02
@po5epT

$(document).ready(function(){
   $('.wrapper').on('click', function(e) {
    if (e.target === this)
      $('.other-wrapper').slideToggle();
  });
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question