Vasileios Vasileios - 1 year ago 127
jQuery Question

Remove empty double quotes in jquery

enter image description here

How can i remove those empty double quotes that displayed inside the

<div class="nav-modal-main"></div>

Thank you in advance!

Answer Source

Use replace()

var tempStr = $('.nav-modal-main').text();
tempStr.replace(/"/g,  '').replace(/,/g,'').trim();

var tempStr = $('.nav-modal-main').text();
$('.nav-modal-main').text(tempStr.replace(/"/g,  '').replace(/,/g,'').trim());
<script src=""></script>
<div class="nav-modal-main">
",   "

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download