Today I Learned - Rocky Kev

Tagged “text”

  1. TIL why you should always use textContent

    Today I learned the difference between 'Node.textContent'. It handles all elements, even hidden ones. It also prevents XSS attacks since it strips tags.

  2. TIL How to check if the string is uppercase

    The magic is comparing str === str.toUpperCase()

See all tags.