Fork me on GitHub

FlagStrap v1.1

View on Github

Default No options or data attributes

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

Result



Example Customer default value

$('#origin').flagStrap({
    placeholder: {
        value: "",
        text: "Country of origin"
    }
});

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