Don't Use innerHTML Unless You Want To Be Hacked

Поделиться
HTML-код
  • Опубликовано: 15 дек 2021
  • Full Cross Site Scripting Video: • How To Prevent The Mos...
    Full Cross Site Scripting Article: blog.webdevsimplified.com/202...
    🌎 Find Me Here:
    My Blog: blog.webdevsimplified.com
    My Courses: courses.webdevsimplified.com
    Patreon: / webdevsimplified
    Twitter: / devsimplified
    Discord: / discord
    GitHub: github.com/WebDevSimplified
    CodePen: codepen.io/WebDevSimplified
    #Shorts

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

  • @WebDevSimplified
    @WebDevSimplified  2 года назад +635

    IMPORTANT:
    I want to clarify some points made in this video. Many people are saying that this is not an issue since it only shows you your own cookies and you can easily get that from the dev tools, but this can be used to get anyone's information. Since the data for the query is stored in the URL it means if you send that URL to anyone and they click on it the browser will inject and execute your code. This code could do anything from send you their cookies/local/session storage, make a network request authenticated as them, among many other things.
    One great example of this would be in a banking scenario. If a bank had this vulnerability you could write code that would execute a network request to the bank's backend transferring money from the user's account to your account. Then just put that code in the URL and send the URL to a bunch of people. Anyone that clicks on that URL will be directed to the page and the code will run automatically in the background. If the user was already logged into their bank then your code would execute with their credentials and send their money to your account.
    Another popular place you will see this is with things like comments. If RUclips used innerHTML to post all the comments I could write malicious code like

    • @jersoncarin1952
      @jersoncarin1952 2 года назад +19

      some people can't understand what he mean to be

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

      That's nice.

    • @supercrazysquid
      @supercrazysquid 2 года назад +1

      Roblox had that issue a while ago too

    • @rakesh1594
      @rakesh1594 2 года назад +1

      Hey, Do you also teach on udemy, if yes please share your course links here 😅

    • @bougeurraelouanes1594
      @bougeurraelouanes1594 2 года назад +5

      it will be nicer if you name this attack "xss vulnerability"

  • @nekoill
    @nekoill 2 года назад +39

    My man has so many pieces of invaluable knowledge, really glad I subscribed

    • @madhousenetwork7765
      @madhousenetwork7765 2 года назад +2

      Welcome. He helped me cracked interviews for two jobs (different switches) in the last 2 years

  • @nwstraith
    @nwstraith 2 года назад +11

    Never trust what the client sends and always be suspicious of links in your emails.

  • @giulianobellini8168
    @giulianobellini8168 2 года назад +463

    I like the tip, but I think the title being as "Don't Use innerHTML..." is just toooo bold, I would change the "Don't Use" with "Careful with..." as this is such important method in my opinion. Cheers

    • @ujirooduokpe8243
      @ujirooduokpe8243 2 года назад +6

      That's true. Also, there are ways to handle cross site scripting attacks especially if you want to save the user input on the server. Form validation helps.

    • @pete531
      @pete531 2 года назад +16

      its all about clicks !

    • @RafiesAwesomeChannel
      @RafiesAwesomeChannel 2 года назад +30

      This is a better form of clickbait because its true and still gets clicks (coined "legitbait"). He is telling you not to use innerHTML and the reason why. He should definitely keep it how it is. See this veritasium video for the differences in constructive and destructive clickbait ruclips.net/video/S2xHZPH5Sng/видео.html

    • @thedev6368
      @thedev6368 2 года назад +6

      Ahh but then the title isn’t as click baity

    • @henryho952
      @henryho952 2 года назад +1

      Agree.

  • @Bazkur98
    @Bazkur98 2 года назад +252

    I don't know, this is a very specific use case, as others have said "don't use innerHTML" is very misleading. Maybe "Careful when using it with user inputted data"

    • @petarp3938
      @petarp3938 2 года назад +9

      And that's why you clicked the thumbnail

    • @dr_birb
      @dr_birb 2 года назад +7

      @@petarp3938 and I thankful I did, some actually important shit to learn. And to clear things up ya just go tp comments to get more info or other notes.

  • @daleryanaldover6545
    @daleryanaldover6545 2 года назад +225

    This only applies when dealing with user input, if you are rendering server side html content then it's fine. Also a good user input validation and sanitation prevents such attacks, be it server side or client side
    Edit: Most database API handles encoding already so most developers won't really need to manually do output encoding. Nevertheless it is nice to know.

    • @ko-Daegu
      @ko-Daegu 2 года назад +8

      Times & time again we see work around sanitation’s
      Can’t trust them fully

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

      Encoding is the solution. Not validation and sanitation.

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

      @@ko-Daegu I think my sanitizer is failsafe. I strip all attributes except class .

    • @ricardoamendoeira3800
      @ricardoamendoeira3800 2 года назад +7

      Sometimes server side html includes user input (like a username, a comment, etc), so that's not something you should rely on in general, only when you know it's safe.
      And input sanitization is a hack, you might sanitize it for HTML but then it gets used in a SQL query and you end up with SQL injection. Realistically you're not going to sanitize for every possible interpretation, so it's a losing game. Encoding and prepared statement-like constructs are the way to go.

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

      @@ricardoamendoeira3800 I agree with prepared statements 100%. In my app I have one place where users can mark up a config file with simple html that only allows div and class/style. It is validated. They can also insert a (hotspot) link with a % that gets expanded and the link is for a certain purpose(e.g to switch a tab). Probably is a small risk but that is their requirement., BB code on BBses used to allow square brackets that were expanded to HTML.

  • @stevenstraker5105
    @stevenstraker5105 2 года назад +20

    It's worth mentioned that the reason he posted this is because cases like this actualy do happen in the wild, as some people don't already know the dangers of trusting user input and loading it in with innerHTML.
    A lot of you mentioned methods of sanitizing the data either via the client side or the server side, and all that which is good, but I think the important message he is illustrating is the danger of trusting and outputting HTML based on user input. Sites and applications we build need to be tested for vulnerabilities, and this is one of the more basic ones to watch out for.

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

      Yea you never wanna send raw html since you can also send other users information or even cheat in a video game such as cards

  • @FGj-xj7rd
    @FGj-xj7rd 2 года назад +115

    User inputs MUST always be sanitized from the server side.

    • @carlonnrivers
      @carlonnrivers 2 года назад +21

      This isn't even a server side issue. Just plain client side JavaScript makes this dangerous, too

    • @andresaliba
      @andresaliba 2 года назад +1

      Client and Server side, actually.

    • @ko-Daegu
      @ko-Daegu 2 года назад +10

      @@andresaliba always:
      Client = UX
      Server = actually security

    • @ricardoamendoeira3800
      @ricardoamendoeira3800 2 года назад +10

      Sanitization is a losing game, there are dozens of possible interpretations for every input, HTML, JS, SQL, etc, are you going to sanitize for all of them?
      Just make sure you encode things correctly and use things like prepared statements or textContent to not mix data and code.
      Would you say running eval() or arbitrary user input is safe as long as you sanitize it? You're playing with fire when you use innerHTML, it's basically eval() for HTML.

    • @markusjohansson4949
      @markusjohansson4949 2 года назад +2

      @Paul Moore Ricardo is right. Encoding is the answer.

  • @marveII0us
    @marveII0us 2 года назад +1

    XSS and SQLi is one of the very first challenges and problems that software developers are taught. Great work

  • @marimuthur9456
    @marimuthur9456 Год назад +1

    Try to post this type of videos in separate playlist it's very useful and it's awesome for us for developing the project as well as we will try to avoid this vulnerabilities👌🏼👌🏼👌🏼😊🙏🏼

  • @talwat321
    @talwat321 2 года назад +27

    Can we appreciate he put together some nice looking css for this example instead of using plain HTML?

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

      Indeed haha, it's quite cool!

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

      Looks like a tpl of tailwind or sth tho?

  • @JustWithAll
    @JustWithAll 2 года назад +22

    If user credentials kept open like this in cookie, anyways it is insecure either you use innerhtml or not

  • @moretimeproductions
    @moretimeproductions 2 года назад +1

    And thats why you don't allow in input fields...

  • @jamisonmartino1136
    @jamisonmartino1136 2 года назад +1

    Reflected XSS is nasty

  • @thenecessarytruth3102
    @thenecessarytruth3102 2 года назад +2

    The important thing to remember here is to always sanitize your inputs. No matter the language you are using and how you are processing your data.

  • @8koi139
    @8koi139 2 года назад +9

    innerHtml is also pretty heavy on resources, so bad practice overall! :p

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

    People used to get their MySpace hacked this way back in 06.

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

    This form of attack is called a reflected cross site scripting attack (xss). Normally the javascript is inserted into a url, encoded and then sent by email to a target. Once the link is pressed the javascript is executed, which could have many payloads but the simplest one is to send the targets cookie details to the attacker. There are two other types of xss attacks which are stored xss and cross site request forgery.
    To protect websites against these sort of attacks input validation needs to be used to filter out html tags, single quotes and double quotes plus semi colons.

  • @Kiev-en-3-jours
    @Kiev-en-3-jours 2 года назад +13

    That's kinda true:
    - If you don't sanitize inputs,
    - If you don't know what you are doing & you don't understand when it is safe to use innerHTML and when it is not.
    It's actually safe to use innerHTML 99.99% of the time.
    Saying "Don't Use innerHTML unless You Want To Be Hacked" is bullshit.
    But I guess it can help junior developers realizing some specific use case can be dangerous.

  • @CollidaCube
    @CollidaCube 2 года назад +44

    I'm confused you just end up hacking urself when you inject this code.

    • @weshuiz1325
      @weshuiz1325 2 года назад +6

      Its fine doing that to ur self
      But hey can send/post the link to other people,

    • @omniomi
      @omniomi 2 года назад +12

      It becomes dangerous when a hacker crafts a &query= string that can post to a collection endpoint they control, take advantage of a browser vulnerability, etc. They can then sends that link to other people (targets) and potentially collect their data or harm their machines.
      In the video example it was grabbing cookie content. Now what if it also sent that to a malicious party controlled server?

    • @kidShibuya
      @kidShibuya 2 года назад +2

      @@weshuiz1325 And they are just hacking themselves...

    • @kidShibuya
      @kidShibuya 2 года назад +8

      @@omniomi And on a static page as per the example this happens how? You can ONLY hack yourself via this method. If you think otherwise you clearly don't understand the web.

    • @opensourcerer9927
      @opensourcerer9927 2 года назад +10

      @@kidShibuya Just because he didn’t showcase the vulnerability on a dynamic site doesn’t make it less harmful. The principle is the same. If you output unsanitized HTML that contains user written text on to the page using innerHTML, you’re literally begging someone to perform an XSS attack on your website.
      By the way, you’re completely wrong. If I knew that you were currently developing an application like the one shown in this video, I would be able to get every piece of information you got stored in ls/cookies by sending you your own link together with a http post request to my database.

  • @rafidhoda
    @rafidhoda 2 года назад +1

    Damn! Never thought about that. Thanks!!

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

    This is essentially printf(userString) and printf("%s", userString) for the web

  • @ivanflorencioyt
    @ivanflorencioyt 2 года назад +25

    Good tip Kyle, but I think you can do it anyway writing alert(document.cookie) in the console, dont u?

    • @WebDevSimplified
      @WebDevSimplified  2 года назад +36

      Yes but the difference is this code can be injected into other people's browsers since it is stored in the url. You can then have the code send their information to an API you control which is bad. Console log only shows you your own information

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

      That's just called self-xss

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

      @@WebDevSimplified of course, tks 😉

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

      If the injected code the hacker writes is not loaded by other users, then this is a useless hack. If, however, it's published onto other user's screens, like if the text field was for a public comment, then this hack will work.

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

      @@WebDevSimplified I think this is what people are thinking, consider pinning this comment.

  • @4xHitler
    @4xHitler 2 года назад +1

    oh well thanks for notifying me but I already did my whole language library using innerHTML. maybe when I make a JS-less webpage or whatever comes next.

  • @aman9800
    @aman9800 2 года назад +2

    I’ve never seen a dev project where passwords and users are used in a cookie, most of the time it’s session ids….

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

    This is really about trusting user input. No matter the technique, user input can not be trusted, and that includes cookies! My concern is that this is misleading to new developers, because setting innerHTML programmatically provides the best browser performance in most cases. If you don't understand the context, you might think that innerHTML itself is something you should never use.

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

    God you're amazing, xss is so common yet so easy to fix

  • @TreeLuvBurdpu
    @TreeLuvBurdpu 10 месяцев назад

    The browser-owner can edit any JavaScript used in the browser

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

    hi

  • @semirdin3271
    @semirdin3271 2 года назад +1

    It is called DOM xss

  • @itsmeolee6710
    @itsmeolee6710 2 года назад +10

    Wow I had no idea. I'm a Junior dev, and thankful to learn this now, rather than later. Thanks!

    • @titandps1149
      @titandps1149 2 года назад +2

      as usual take this with a grain of salt, saying simply just don't use inner html is a bit misleading, sometimes you need this function. what you should do is to always validate the user input (be it coming from a form field or a get parameter) before displaying it or storing in the database. as to actual topic read/watch a video about xss to understand why can it be dangerous, and how can somebody craft links with manipulated parameters to attack your visitors. following advice blindly regardless of how good it is without understanding is not ideal

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

      @@titandps1149 what this is saying: avoid innerhtml when handling user input if possible.

  • @busyrand
    @busyrand 2 года назад +1

    I'm familiar with issues of sanitizing data when coding with PHP so I'm not sure if that would address the issue... I quite sure it does, however I'll definitely check out the video you reference. You're a good teacher.

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

      if you send a $_GET or $_POST and reflect it on the page immediately without sanitizing, you will face this issue. It’s called reflected XSS vulnerability

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

    Escape special symbols on server side - ❌
    Do not use innerHTML - ✔️

  • @shahroozj
    @shahroozj 2 года назад +2

    If you say it shows you the password and sensitive information it is because we should save sensitive data encrypted in cookies. It doesn't make sense to me! if you can do something with innerHtml you can do it in dev tools as well. Please give us a real example to show the vulnerability.

  • @connorb2742
    @connorb2742 2 года назад +1

    NO ONE SHOULD HAVE THIS MUCH POWER.

    • @connorb2742
      @connorb2742 2 года назад +1

      Now i am coding this based malware thanks

  • @parthokr
    @parthokr 2 года назад +1

    Client side security really doesn’t make sense. I appreciate using textContent instead of innerHTML. But what if I intentionally open up console and run document.cookie I am getting it out of the box. It is helpful but not necessarily if the queried data is sent over an endpoint and being run on the server side I would again implement anti code injection methods provided I have already implemented it on the client side. So what is the rundown? If a user really wants to tinker with the frontend I will let him do that. Once he spun off a request with modified data I will more likely love to redirect or respond an erroneous appreciation for trying so.

  • @transgrl
    @transgrl 2 года назад +1

    PHP also suffers from this, ALWAYS SANITISE YOUR INPUTS!

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

    This vulnerability is called DOM XSS

  • @beinyourguard
    @beinyourguard 2 года назад +1

    kyle please make a video about styled components

    • @JEsterCW
      @JEsterCW 2 года назад +2

      what do u not understand about them tho lmao styled components are so easy to get used to them lmao

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

    What about a short explaining why we shouldn't use evil() I mean eval()?

  • @rodrigofernandes6449
    @rodrigofernandes6449 2 года назад +8

    that´s why you use server side verification, in my page i use php to first remove any html on the string and only then send the result

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

      Despite sanitising there, you must again check and sanitise on what is sent to the server as well from the server end itself. Otherwise you may be removing HTML but god knows maybe someone injects wasm in there and you will not know.

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

      @@ItsMeChillTyme that´s kinda obvious. The golden rule is to never trust anything the user send you.

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

    Thanks for the tip.

  • @jenkathefridge3933
    @jenkathefridge3933 2 года назад +1

    Thanks,now i'm going to steal every sensitive info hehehehe.

  • @danielwood2432
    @danielwood2432 2 года назад +1

    What kind of person stores their password in plain text in cookies? You deserve to get hacked.

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

    If this man is blindfolded he will look like Satura Gojo

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

    Very useful and interesting topic to discuss on.
    Why don't you make more videos or may be a complete series on ethical hacking and cyber security?

  • @udehsamueledwards9576
    @udehsamueledwards9576 2 года назад +1

    If the cookie is "http only" it won't be displayed

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

    this state just in when you get input from user and you want to display he input only but in other cases not mind

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

    This hack was very common about 2 decades ago. Now it has drastically reduced as large scale web applications enforce thorough validations. So it may not really matter for some web applications.
    We just need to be careful with innerHTML, not don't use it.

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

    This vulnerability is very similar to SQL Injection

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

    You miss the point in that this is only a security bug if you're making a site/app where users can enter data and have it stored somewhere to be later viewed by others

  • @ShiraIshikawa
    @ShiraIshikawa 2 года назад +1

    First, don't store username password on cookies. Cookies are for user preferences, not storing credentials. Second, at least escape any string you get from input.
    As far as I know, XSS is disabled by default on many servers, but yes you need to be careful using raw user input.

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

    Thank u kyle❤️

  • @antidotejack2771
    @antidotejack2771 2 года назад +1

    No body told me that before. Thank you!

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

    This what was happening with New World chat system lol

  • @riccardopalleschi
    @riccardopalleschi 2 года назад +1

    Love you Kyle

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

    Thank god i've never use innerhtml to display text input from user

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

    Any "sensitive" information stored in the page, is anyways not safe.

  • @debjit21
    @debjit21 2 года назад +7

    There must be a server side validation rule, if not your server is compromised already, you just don't know that yet.

    • @markusjohansson4949
      @markusjohansson4949 2 года назад +1

      No. That's not right. This is client JavaScript and he tells you in the video how to avoid the issue.

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

    Thanks for this 😊🙂😊

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

    Thanks for this.

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

    The fact the password is in the cookie and not even hashed is a far more worrying issue.

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

    I have a react blog that uses inner innerhtml for the blog posts because I have styles like bold, strike through, etc in the blog content. What should I do in replace of innerhtml to get those styles to show up?

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

    Thanks!

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

    I think it's more nuanced than described here.
    innerHTML will render text as HTML to the DOM. This isn't a problem if you are creating non-dynamic code blocks and inserting them in the DOM or even when appending dynamic data as long as the source is trusted.
    However, IF the data you are appending is comes from a non-trivially insecure source or (and this is the big one) includes user input, you should avoid it because someone could then run JS on your page, potentially stealing user data.

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

    And that's the XSS.

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

    DOMPurify if you want added level of assurance

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

    I try to tell people this, lo and behold they use innerHTML

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

    But we use post method for sensitive data. Search is GET I don't know if it's advisable to store sensitive info on the page. Great video too

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

    Thanks man

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

    Tyvm!

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

    Why is the sensitive info being stored on the page though?

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

    using innerHTML is fine. but you need to escape the special characters such as < and >

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

    You shouldn’t store sensitive information into the webpage, when validating you should use POST not GET

  • @rickieanand3535
    @rickieanand3535 2 года назад +1

    Who saves passwords in cookies 😂

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

    Very needed

  • @0x5D
    @0x5D 2 года назад

    Also don't put sensitive info directly in the document.cookie

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

    2 words: input sanitization

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

    T is all frontend, so it could be edited by anyone. Document cookies aren’t secure no matter what unless they are marked as such, making them inaccessible to JavaScript

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

    Inner Text would work fine too

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

    How can i do that green black style?

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

    There are much bigger issues with innerHTML than this.
    One issue is that it used to (likely still does) have many memory leaks.
    Another is that it causes a part of the page to be re-rendered causing some references to break. I even had some references break that were for a different part of the site costing me many hours of debugging.

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

    In a scenario like this while I was fiddling I used innerText which I think does something similar?

  • @238SAMIxD
    @238SAMIxD 2 года назад

    Is it better to use .textContent indead of .innerText while setting text of the element?

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

    always sanitize user input

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

    Did you have to turn off Chrome's XSS protection for this? Chrome doesn't let JS code be executed if it appears in the URL

  • @GRBtutorials
    @GRBtutorials 2 года назад +1

    Of course, the problem comes when you *want* to allow people to put HTML, or worse, JS, on the page…

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

    If you store your plain password in cookies you deserve that

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

    is innerHTML the only way to use string literals?

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

    I simply don't understand! This point leaves me completely cold.

  • @henrypierre5285
    @henrypierre5285 2 года назад +1

    Can I use innerText?

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

    Do we need to worry about this if we using any framework

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

    Okay but this is still used every day when we make components because like you showed rendering a component as text content will just show your component as a string on the webpage. Sanitization doesn’t take long to use and innerHTML is too important to use so we can just take the extra 5 minutes to sanitize.

  • @yehannk448
    @yehannk448 2 года назад +1

    is there any safe use of innerhtml ? for things which we don't input is it safe to use it

    • @WebDevSimplified
      @WebDevSimplified  2 года назад +2

      As long is it is not ever coming from using inputted data you are fine.

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

      @@WebDevSimplified thanks

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

    that’s just like typing alert(document.cookie); in the console

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

    Classic xxs, an id session will avoid this kind of trick.

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

    Excellent!

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

    Very useful

  • @kenny-kvibe
    @kenny-kvibe 2 года назад

    First time of hearing about textContent, what's the difference from innerText ?
    You can use innerHTML with user's input, but only if you html-encode the input value first (the < becomes < and so on) so the title is kind of misleading.

  • @innerlion7564
    @innerlion7564 4 месяца назад

    What about innerText?