KnockoutJS: Event object
问题 This question is related to KnockoutJS: Tracking menu clicks. I have been able to tell which menu was clicked by supplying an id value. I need to change this model and use the event.target to obtain additional information. I tried this but it does not seem to work. I also created global function menuClicked : var viewModel = {}; function menuClicked(event) { var id = ($(event.target).tmplItem().data).Id; var isActive = viewModel.menuActive(); if (!isActive || viewModel.currentMenu() == id)