diff --git a/src/core.js b/src/core.js index c66f7584a..2f6c9af17 100644 --- a/src/core.js +++ b/src/core.js @@ -1032,7 +1032,10 @@ $.extend( $.validator, { // meta-characters that should be escaped in order to be used with JQuery // as a literal part of a name/id or any selector. escapeCssMeta: function( string ) { - if (string === undefined) return ""; + if ( string === undefined ) { + return ""; + } + return string.replace( /([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1" ); },