Skip to content

Commit 1aaf863

Browse files
committed
added "for" accessability tags to labels
1 parent a37523d commit 1aaf863

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

js/bootstrap-switch-button.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,13 @@
7979
// 1: On
8080
var switchOn = document.createElement('label');
8181
switchOn.setAttribute('class', 'btn btn-'+this.options.onstyle+' btn-'+this.options.size);
82+
switchOn.setAttribute('for', this.element.id)
8283
switchOn.innerHTML = this.options.onlabel;
8384

8485
// 2: Off
8586
var switchOff = document.createElement('label');
8687
switchOff.setAttribute('class', 'btn btn-'+this.options.offstyle+' btn-'+this.options.size);
88+
switchOn.setAttribute('for', this.element.id)
8789
switchOff.innerHTML = this.options.offlabel;
8890

8991
// 3: Handle
@@ -191,6 +193,7 @@
191193
else this.off(silent);
192194
}
193195
trigger(silent) {
196+
// TODO:
194197
//switchBtn.off('change.bs.switch');
195198
//if ( !silent ) this.element.change();
196199
//this.element.on('change.bs.switch', $.proxy(function() {

0 commit comments

Comments
 (0)