Q: Click function 'jQuery' for dynamic list items (using Knockout.js) not work I have the following HTML (using knockoutjs).
<ul data-bind="foreach: contacts">
   <li class="user-box"><span class="user-box-name" data-bind="text: username"></span></li>
</ul>

When he tried to assign the event 'click' to the class via jQuery ("user-box-name"), I can not. This way:
    $(document).ready(function () {
      $('.user-box-name').on('click',function(){
        callFunction();
      })
      function callFunction(){
      }
    });

And it did not work! Has anyone experienced this? Is it because the object is dynamic? I am a beginner with knockoutjs.
The function you want to call this inside document.ready!
Already very grateful for the time of you.

A: If you're using knockout, you may use it's special binding "click".
Like this:
<ul data-bind="foreach: contacts">
    <li class="user-box"><span class="user-box-name" data-bind="text: username, click: function() { alert(':)') }"></span>  </li>
</ul>

Knockout allows you to use all the advantages of MVVM approach.
So it's even better to define handlers in your view model, neither attach handlers with jQuery. 
