0

How to call function with "this" from event? If remove "this", it will work.

function Parent()
{
 this.child = function()
 {
  alert("called child");
 };
    $("#btn1").click
 (
  function() 
  {
   this.child(); // doesn't work
  }
 );
}
var objp = new Parent();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<button type="submit" id="btn1">Submit</button>
Shalom
  • 1

0 Answers0