I trying to write a script using jQuery, it is suppose to automatically put a space after every comma "," in order to separate a sequence of numbers that user input in an input field. e.g. if they enter (45,68,95,23) it becomes (45, 68, 95, 23) when the user moves away from the input field.
检查这些投入是否含有ma子
$("#test").blur(function() {
if(this.value.indexOf(",") !== -1) {
alert( got a comma );
}
});