# Javascript image dropdown - Object oriented approach

# Javascript image dropdown Download

| Documentation

Object Oriented Approch

    //create
    var oHandler1 = $("#browsers").msDropdown().data("dd");

| view code |

    $("#getIndex").on("click", function() {
        //var index = oHandler1.get("selectedIndex");
        var index = oHandler1.selectedIndex; //above line is same
        console.log("index: "+index);
    });

| view code |

    $("#setIndex").on("click", function() {
        var ind = document.getElementById("txt_index").value;
        oHandler1.set("selectedIndex", ind);
    });

| view code |

    $("#btnDisable").on("click", function() {
        var isDisabled = oHandler1.get("disabled");
        oHandler1.set("disabled", !isDisabled);
    });

| view code |

    $("#btnOpen").on("mouseenter", function() {
        oHandler1.open();
    });

| view code |

    $("#btnShowHide").on("click", function() {
        var isVisible = oHandler1.visible();
        oHandler1.visible(!isVisible);
    });

| view code |

    $("#getUIData").on("click", function() {
        var uiData = oHandler1.uiData;
        console.log(uiData)'
    });