Special Character Function

This function used to resolve special character issue in the words.

function escapeWord(word){
      var specialChar = {
           "<": "&lt;",
           ">": "&gt;",
           '"':"&quot;",
           "'":"&apos;",
           "&":"&amp;",
        }

escapeWord("testword&testpurpose");

Leave a comment

Your email address will not be published. Required fields are marked *