I'm trying to remove quotas from displayed HTML which is generated based on AJAX response.
HTML output looks like:
<ul id="ui-id-1" tabindex="0" class="ui-menu ui-widget ui-widget-content ui-autocomplete ui-front" style="top: 342px; left: 262px; display: none; width: 881.094px;">
<li class="ui-menu-item"><div id="ui-id-15" tabindex="-1" class="ui-menu-item-wrapper">"Test Tester" <test1@null.com></div></li>
<li class="ui-menu-item"><div id="ui-id-16" tabindex="-1" class="ui-menu-item-wrapper">"Baba Ganush" <test2@null.com></div></li>
</ul>
HTML output become visible when there are returned values.
jQuery code to remove quotas:
$( document ).ready(function() {
if($('#ui-id-1').is(':visible')) {
$('.ui-autocomplete.ui-front li.ui-menu-item div:contains("\"")').each(function(){
$(this).html($(this).html().split("\"").join(""));
});
console.log('VISIBLE');
}
});
But when I have it tested it looks like f($('#ui-id-1').is(':visible'))
is not triggered when outputted HTML appear on a screen.
Any clue why is not working?