JavaScript DOM - 2020 - #4 - InnerHTML vs InnerText vs TextContent - Tharun Shiv

Поделиться
HTML-код
  • Опубликовано: 3 ноя 2024

Комментарии • 12

  • @kupopo1
    @kupopo1 3 года назад +4

    Please note that the newlines you see in the textContent are _not_ due to the tags, but to the literal newlines in the HTML source - that's why there's two newlines before and after the main text, rather than one. Element.textContent just blindly concatenates all the text nodes' contents, regardless of whether they would be visible on the page or not (i.e. it includes and tags), whereas innerText is the human-readable text you would see on the page, and is more akin to what you would get if you copy-pasted the text.

  • @ZiadMohammedamin
    @ZiadMohammedamin День назад

    Nice😮😮

  • @ananyadas3501
    @ananyadas3501 Год назад

    Thank you for this short useful video

  • @coskuncabuk3119
    @coskuncabuk3119 3 года назад +2

    This is really good but you should have shown entire HTML and CSS codes

  • @reidwilliamson6477
    @reidwilliamson6477 8 месяцев назад

    Great explanation thank you!

  • @thesafaripictures3453
    @thesafaripictures3453 3 года назад +2

    amazing tutorial sir

  • @tramarthomas6105
    @tramarthomas6105 2 года назад

    Thank you for the video :) one question though, is there a difference between setting the three? Or do they all to the same thing

  • @MohamedAmr999
    @MohamedAmr999 Год назад

    Thanks great video

  • @desudupradeepkumar3751
    @desudupradeepkumar3751 Год назад

    Why inner HTML is capital letter

    • @RN-Samarjit
      @RN-Samarjit 7 месяцев назад

      its a syntax of js

  • @kseniiaazovtseva6139
    @kseniiaazovtseva6139 5 месяцев назад

    ok?