Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67469

String.prototype.replace wont replace a × character

$
0
0

Oh God Why does this not work??? Ok, trying to be cool now x).

The HTML part Im fetching with JQUery is:

<div class="chip">
              #<c:out value="${pred.id } "></c:out><span class="closebtn">&times;</span>
          </div>

I use this JQuery to fetch the elements with class "chip":

function getChips() {
      var output = "";
      $('.chip').each(function() {
          output += $(this).text().trim();
      });
      output = output.replace(/U00D7/gi,"");
      return output;
  }

So. It does fetch the correct elements. So far so good. and function above returns the inner text of each element of class "chip". But it does NOT replace the "times" character that can be seen in the html fragment above. I tried: output = output.replace(/U00D7/gi,""); and I tried: output = output.replace(/&times/gi,""); and even being desperate and trying: output = output.replace(/x/gi,""); and: output = output.replace(/X/gi,"");

Still get an output from the function with &times symbols in it. I expect a string with &times symbols replaced with a space or even better, nothing at all ->"".

Thanks


Viewing all articles
Browse latest Browse all 67469

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>