FlagStrap v1.1


Default No options or data attributes

$('#basic').flagStrap();

Result



Example Customer default value

$('#origin').flagStrap({
    placeholder: {
        value: "",
        text: "请选择一个国家"
    }
});

Result



Example Using data attributes to pre-select a country

 $('#options').flagStrap({
    countries: {
        "AU": "Australia",
        "GB": "United Kingdom",
        "US": "United States"
    },
    buttonSize: "btn-sm",
    buttonType: "btn-info",
    labelMargin: "10px",
    scrollable: false,
    scrollableHeight: "350px"
});

Result



Example Custom onChange event

$('#advanced').flagStrap({
    buttonSize: "btn-lg",
    buttonType: "btn-primary",
    labelMargin: "20px",
    scrollable: false,
    scrollableHeight: "350px",
    onSelect: function (value, element) {
        alert(value);
        console.log(element);
    }
});

Result