html - Make the span element inside div clickable -
i have dropdown list using javascript. inside div have span element text div, because want show/hide text according screen size. added span element span area not clickable. other parts in div clickable , show menu, except area span. how make span clickable well?
here's code:
<div onclick="dropdownfunction()" class="dropbtn"><span>my list </span> <i class="fa fa-arrow-circle-down" aria-hidden="true"></i></div>
and codepen: http://codepen.io/nfds89/pen/mylgkr
an alternate css-only solution pass through clicks on <span>
, <i>
.dropbtn span, .dropbtn { pointer-events: none; }
Comments
Post a Comment