Home >Web Front-end >JS Tutorial >js uses an array to determine whether the same data exists in the submitted data_javascript skills

js uses an array to determine whether the same data exists in the submitted data_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:12:031820browse
Copy code The code is as follows:

var productIds = $(".productId");
var arry = new Array();
arry = productIds;
var ary=arry.sort();
for(var i=0;i if(ary[i].value==ary[i 1].value){
alertMsg.confirm("The same medicines were detected, please check!", {
});
return;
}
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn