JS, how to replace `& quot` with quotes correctly
<input type="text" autocomplete="off" class="Autocomlete1" name="test"> $('.Autocomlete1').typeahead({ ajax: { url: './test.php?log=test', triggerLength: 1 }, updater: function(item) { return item; }, onSelect: function(item) { return item; } }); After the auto command in input we get the following value - Text " TextTextText " Text " TextTextText " (database row matters), but the output is Text " TextTextText "
To replace " to " I want to do:
onSelect: function(item) { var text = item.text; var text = text.replace(/"/g, '"'); $('.Autocomlete1').val(text); return item; } But this does not work ...
Please tell me how to replace " with quotes correctly?