Append a space with jQuery
72,951
Solution 1
How about
$("#mySelector").append(" "); // or with & nbsp;
Solution 2
In my case I did the following:
$('.colwid10a').each(function () {
if ($(this).is(':empty')) {
$(this).append(" ");
}
});
$('.colwid12').each(function () {
if ($(this).find('a').is(':empty')) {
$(this).find('a').append(" ");
}
});
Comments
-
Joel Harris almost 2 years
I'm trying to append a space using jQuery. Neither of these samples work:
$("#mySelector").append($(" ")); $("#mySelector").append($(" "));
Any ideas?