Skip to content

Commit d29777c

Browse files
committed
Properly escape CSS notation
1 parent e4cf453 commit d29777c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/selectize.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ $.extend(Selectize.prototype, {
129129

130130
if(inputId = $input.attr('id')) {
131131
$control_input.attr('id', inputId + '-selectized');
132-
$('label[for='+inputId+']').attr('for', inputId + '-selectized');
132+
var inputIdEscaped=inputId.replace( /(:|\.|\[|\]|,)/g, "\\$1" );
133+
$('label[for='+inputIdEscaped+']').attr('for', inputId + '-selectized');
133134
}
134135

135136
if(self.settings.copyClassesToDropdown) {

0 commit comments

Comments
 (0)