-1

Look at this code:

<div>
   <p onClick="parentNode.remove()">click me</p>
</div>

Is it accessing dom via js.

I saw similar example example somewhere and it worked.

  1. How is it possible without js or is it somehow javascript
  2. Will it work if js is disabled in browser.
  3. Where can I look for similar functions. mozilla's dom api docs were not very helpful for me as I could not even find that parentNode.remove() function.
topenion
  • 390
  • 3
  • 12
  • 2
    Possible duplicate of [How does inline Javascript (in HTML) work?](https://stackoverflow.com/questions/10607847/how-does-inline-javascript-in-html-work) – Brian H. Nov 19 '18 at 11:37

1 Answers1

0
  1. It is "somehow" javascript.
  2. No. It's legit js so it will not work.
  3. ParentNode remove

    You can look at this question for clarification How does inline Javascript (in HTML) work?

Smollet777
  • 1,618
  • 1
  • 16
  • 15