The example in this article describes how jQuery can achieve the deduplication effect of tag notes. Share it with everyone for your reference. The specific implementation method is as follows:
The html code is as follows:
delRepeat.js code is as follows:
var uniqueArr = [];
$.each(strArr, function(i, el){
if($.inArray(el, uniqueArr) === -1) uniqueArr.push(el);
});
$('#repeatValue').val(uniqueArr.join(" ")); //Combine the strings
}
I hope this article will be helpful to everyone’s jQuery programming.