The project requirements are shown in the figure:
Code:
The code copy is as follows:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="jquery.js"></script>
<script type="text/javascript">
$(function(){
var divArea = $(".drop");
$.each(divArea , function () {
var Dtxid = $(this).text();
var count = 0;
$.each(divArea , function () {
var Xtxid = $(this).text();
if (Dtxid == Xtxid) {
count = count + 1;
if (count >= 2) {
$(this).remove();
}
}
})
})
});
</script>
</head>
<body>
<div>Original Data</div>
<div>
<span>Zhang San</span>
<span>Li Si</span>
<span>Wang Wu</span>
<span>Zhang San</span>
<span>Wang Wu</span>
</div>
<br/>
<div>Data deduplication</div>
<div>
<span>Zhang San</span>
<span>Li Si</span>
<span>Wang Wu</span>
<span>Zhang San</span>
<span>Wang Wu</span>
</div>
</body>
</html>
Isn't it very simple? Friends who have the same needs can refer to it for themselves. The following is just a simple example. If you want to use it for the project, you also need to add some materials to yourself.