Tag Archives: Web software development

[Solved] Jquery addclass reports an error under Firefox

There is no problem with the following code in Google browser and an error is reported in Firefox:

const doms = document.getElementsByClassName("cesium-baseLayerPicker-dropDown")
        for (let i in doms) {
            const dom = doms[i]
            if (dom) {
                $(dom).addClass("scroll-1")
            }
        }

The following modifications are required

 $(".cesium-baseLayerPicker-dropDown").addClass("scroll-1")