SP.Utilities.HttpUtility.htmlEncode(str) Method
Applies to: SharePoint Foundation 2010
In this article
Return Value
Applies To
Remarks
Encodes the specified string for use as text between HTML tags, or as an attribute value inside an HTML tag.
var value = SP.Utilities.HttpUtility.htmlEncode(str);
Parameters
- str
Type: string
- valueToEncode
A string representation of the data to encode.
Return Value
Type: string
Applies To
SP.Utilities.HttpUtility Class
Remarks
The method replaces the ampersand (&), double-quotation (""), single-quotation (‘’), less-than (≤), and greater-than (≥) characters with the appropriate characters.