Append a space with jQuery

Viewed 75195

I'm trying to append a space using jQuery. Neither of these samples work:

  $("#mySelector").append($(" "));
  $("#mySelector").append($(" "));

Any ideas?

5 Answers

You could also use '\xa0', it is a non break space character.

$("#mySelector").append('\xa0');
Related