JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://github.com/downloads/SteveSanderson/knockout/knockout-2.1.0.js"></script>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
Data-bind on Dynamic Element
<div id="menu"><div data-bind="click: myFunction.bind($data, 'param1', 'param2')">ABC Click</div></div>
</body>
</html>
JavaScript
var ViewModel = function() {
this.listItems = ko.observableArray(['Item 1', 'Item 5', 'Ite;m 3']);
this.myFunction = function (data, event) {
alert("you clicked " + event.target.id);
};
};
ko.applyBindings(new ViewModel());