Leetcode Check Palindrome Using Javascript Innerhtml Append