I have a list that is dynamically built, but there are empty list items that need to be removed.
<ul> <li>www</li> <li>www</li> <li>www</li> <li></li> <li></li> <li></li> </ul>
How to do it using jQuery?
$('ul li').filter(function() {return $(this).text() == '';}).remove();
$('ul li:empty').remove();
$('ul').find('li').each(function(){ if($(this).is(':empty')) $(this).remove(); });
Please use the Andy implementation (above mine :))
Source: https://habr.com/ru/post/1741242/More articles:What strategies are effective for handling parallel reads on heterogeneous multicore architectures? - c ++Are the System and System Idle Process PIDs constant on Windows? - windowsAssigning or using MD5 - networkingI need to find the latitude and longitude of the zip codes and save it in my database - phpКакой самый простой способ получить самые высокие и самые низкие ключи от словаря? - pythonwpf textbox tootip binds value - wpfZend Framework, echoing the value of a SUM request - sumpipelines in doubt UNIX - unixWhere not in OR Except for SQL modeling in LINQ for objects - c #Serialize java.awt.geom.Area - javaAll Articles