Remove duplicate elements from list by value with jQuery

jQuery is very useful and easy to learn and it’s very, very powerful. If you look at the code below you’ll see that with a few lines of code we are able to remove duplicate content from the list.

Here is my HTML

<ul >
  <li value="1" name="test" id="test1">test 1<li>
  <li value="1" name="test" id="test3">test 3<li>
  <li value="1" name="test" id="test3">test 3<li>
  <li value="3" name="test" id="test4">test 4<li>
  <li value="4" name="test" id="another1">another 1<li>
  <li value="5" name="test" id="another1">another 2<li>
   <li value="5" name="test" id="another1">another 2<li>
  <li value="4" name="test" id="another3">another 3<li>
</ul>

Here is my CSS

.list {
  
  list-style:none;
}

Here is jQuery

$(document).ready(function(){
  var found = {};
  $('li').each(function(){
    var $this = $(this);
    if(found[$this.attr('value')]){
      $this.remove();
    }else{
      found[$this.attr('value')] = true;
    }
  });
});

You can also read this

Bulker – Face recognition script

Imagine that we have thousands of images inside of a...

def get_ref_face(self, ref_image_path):
        try:

How to write middleware for Express.Js apps

Middleware functions are functions that have access to the request...

var logger = function (req, res, next) {
  console.log('logged')
  next()
}