I have a script which can retrieve url and favicon: MyWebsite
If you click on the ‘share’ button with textarea blank you will see it places a blank item. How do I write in Jquery: if the item has no text/html, hide/remove item? I have tried this:
$('document').ready(function(){
if ($('.item').text('')) {
$(this).hide();
}
});
It doesn’t work. I have also tried other stuff and also on window load, nothing seems to work.
You should not add a row, if the input is empty. So, instead of hiding the new row, you should not add it. You should add it if there is some text.