Js onclick method does not work in Firefox

defines an onclick, that works in both Edge and chrome, but Firefox gg, just self-taught the front end of the web page, but also look forward to your advice, thank you!

</i>
</div>
function searchToggle() {
    if(main.hasClass("search-open")) {
        main.removeClass("search-open");
        $(".search-input").val("");
        $("-sharplocal-search-result").empty();
    } else {
        main.addClass("search-open");
        $(".search-input").val("");
        $("-sharplocal-search-result").empty();
        scrollTo(0,0);
    }
}

the original method name is sidebarToggle () . I thought it was the reason for the method name, and then changed it. I also tried to put the js directly behind the element, but it didn"t work, because I thought about it all alone, so I didn"t write the specification. I hope the seniors can give me some advice.

Mar.23,2021
Under

Firefox, the click events of the child elements in button are blocked, so the span clicks in your button are not valid, but the I clicks in div are valid.
if you need span to have click effect, change button to div , and you can add button style to div .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3f21c-34835.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3f21c-34835.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?