Cellator at the event JS function



  • Type design

    <div>
    <p>Text</p>
    <a onclick="Func()">Bla-Bla</a>
    </div>
    

    May functions be transferred Func() object div without the use of visible seclators, i.e. parent?



  • The nature of the parent knot reference can be used https://developer.mozilla.org/ru/docs/Web/API/Node/parentNode ♪

    <a onclick="Func(this.parentNode)">Bla-Bla</a>
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2