Inserting <li> before class returns <li></li>

Inserting <li> before class returns <li></li>


I'm working on a project that requires me to take numerous classes and put these within a list-item. I have been trying to do this with different methods, such as before, insertBefore and Prepend. All these methods have had the same result. 

Instead of inserting a single <li> in front of the class, a complete list-item has been inserted (<li></li>. 

this is the code I'm using:

  1. <script type="text/javascript">
  2. $(document).ready(function(){
  3. $('.ngg-gallery-thumbnail').insertBefore('<li>');
  4. });
  5. </script>
What am I doing wrong?