0
I’m refactoring a SPA using in practice the MVC with classes and etc...
I made a method that is called when I click on an element <i>
and would like to obtain this element to subsequently delete a relative of his (a <tr>
two levels above).
I’m calling this event in HTML with attr onclick="CalculaController.removeLinha()"
But if I ask to take the this
it returns me the controller class and not the element clicked, I did some tests with event type .on('click', function(){return this});
works but does not stay 100% this with some errors...
Post your code so we can help...
– Rafael Augusto
Solved! in the attr I was calling the metodo with this, but in the metodo I put as parametro this tbm, and this within the class always is the class
– Bruno Cabral