What is the equivalent of document.createTextNode(‘ ‘) in jQuery

Please be careful with the existing answers. They show how to append HTML. HTML is not Text. Treating text as HTML is a) a bug and b) dangerous.

Here is a sane solution:

$('selector').append(document.createTextNode('text < and > not & html!'))

This is using jQuery only for the append part. Nothing wrong with using createTextNode. jQuery uses createTextNode internally in its text(str) function.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)