javascript – How does etsy put divs inside buttons while allowing the entire div to be clickable?-ThrowExceptions

Exception or error:
<button class="unstyled-button text-gray-darker text-decoration-none width-full" id="shop-mgr-button" aria-expanded="true" aria-owns="marketplace-selector-100563">
    <div class="flag">
        <span class="flag-img pr-xs-1">
            <img alt="" class="icon-b-2 seller-nav-icon" src="/images/seller-tools/shop_manager.001.svg">
        </span>
        <h2 class="screen-reader-only">Marketplace selector</h2>
        <div class="flag-body animated left-negative-2px animated-fade-in">
            <div class="h3 mb-xs-0"><!-- react-text: 22 -->Shop Manager<!-- /react-text -->
            <span class="ss-icon ss-dropdown icon-smallest text-gray-lightest pl-xs-1" aria-hidden="true"></span>
            </div>
            <div class="strong grace-name text-gray-lighter">
            </div>
        </div>
    </div>
</button>

I’ve read that putting divs inside buttons is invalid. But how is etsy able to do it and still allow the entire button element to be clickable?

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *