diff --git a/src/bootstrap-filestyle.js b/src/bootstrap-filestyle.js index 20a2951..9a473f6 100644 --- a/src/bootstrap-filestyle.js +++ b/src/bootstrap-filestyle.js @@ -9,6 +9,8 @@ */ (function($) {"use strict"; + var nextId = 0; + var Filestyle = function(element, options) { this.options = options; this.$elementFilestyle = []; @@ -220,10 +222,11 @@ $label; if (id === '' || !id) { - id = 'filestyle-' + $('.bootstrap-filestyle').length; + id = 'filestyle-' + nextId; _self.$element.attr({ 'id' : id }); + nextId++; } btn = '' +