Posted By

crutzdesigns on 02/04/11


Tagged

jqueryhtmlentitieshtmlentities


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

virendrakryadav


jQuery.htmlentities


 / Published in: jQuery
 

Takes a string as an argument and returns it with htmlentities

Usage: $.htmlentities("hello bob&doug");

Returns: <body>hello bob&doug</body>

  1. jQuery.extend({
  2. htmlentities : function(text){
  3. return $('<div/>').text(text).html();
  4. }
  5. });

Report this snippet  

You need to login to post a comment.