1

I am new to knockout.js is it possible to trigger click event in knockout.js?

KKS
  • 3,600
  • 1
  • 27
  • 54
Sid
  • 801
  • 8
  • 19
  • Hi Sid, was your problem not solved by my answer? The reason I ask this is you have accepted the answer but I still have got a down-vote! If your issue was actually solved or not, please mention it in a comment or update your question in both the cases and I'll try to help you. – KKS Jul 12 '16 at 14:03
  • I gave an answer before to assist you writing a good app with MVVM approach. Ideally, your view should update the model instead of you doing it via event such as triggering a click event manually. Anyway, if you are unhappy with the answer, please make sure to comment and tell us more about your problem that needs to be solved. – KKS Aug 08 '16 at 23:25
  • Hello, please check http://stackoverflow.com/a/5658925/3193524 – Marble Daemon Sep 14 '16 at 04:04

1 Answers1

0

There are a few built in bindings for things like this, but you can hook into any event with the event binding.

The event binding allows you to add an event handler for a specified event so that your chosen JavaScript function will be invoked when that event is triggered for the associated DOM element. This can be used to bind to any event, such as keypress, mouseover or mouseout.

http://knockoutjs.com/documentation/event-binding.html

4imble
  • 13,979
  • 15
  • 70
  • 125