Is escaping the same as DOM sanitization?
No. Escaping converts characters like the angle brackets into HTML entities so text renders literally, which is correct when you want to display markup as plain text. Sanitization keeps the content as real HTML but removes the dangerous parts. Use escaping for text output and sanitization only when user content must be rendered as actual markup.