0

This is the html I am using

  <div class="col-md-12 col-sm-12 text-center permissions-submit">
          <button class="btn btn-primary ">Set Permissions</button>
 </div>
//remove extra ending div

Now I have written a method named bindEvents which would do the following

 bindEvents : function(){
        this.$elSubmit = $('.permissions-submit');
        this.$elSubmitButton = this.$elSubmit.find('button');
        console.log('submit',this.$elSubmitButton);
        this.$elSubmitButton.on('click',this.permissionsSubmit.bind(this));
    }

The issue is that,nothing happens on the button click. It is supposed to call the method "permissionsSubmit".

2
  • jsfiddle.net/arunpjohny/bauxkznt/1 - seems fine.. how is bindEvents called Commented Apr 7, 2016 at 6:12
  • @ArunPJohny yes,it was working for me in fiddle too. But in my page which Iam working it is not. Any ideas for debugging? Commented Apr 7, 2016 at 6:55

1 Answer 1

1

why don't you try this as it's mentioned on jQuery API.

 $( "#foo" ).bind( "click", function() {
        //Do your work here
  });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.