I want to replace <span class="test">,</span>  to , I have tried as
if($('.elq-form').hasClass('elq-form')) {
   $(".elq-form").html( $(".elq-form").html().replace(/<span class="test">,</span>/g,",") ); }
} 
I'm getting
Uncaught SyntaxError: Invalid regular expression flags
how to replace the span tag with comma(,) ?