JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<h4>Clicking the anchor created by clicking 'Summarize' should cause an alert, but doesn't.</h4>
<a href="#" data-bind="click: summarize">Summarize</a>
<div id="plot1"></div>
<div id="summary1" style="display:none;">
<a data-bind="text: 'anchor-text-replaced', click: function(data, event) { alert('anchor clicked!'); }" href="#">anchor-text</a>
</div>
<hr />
<h4>Clicking this anchor causes the alert as exptected.</h4>
<div id="plot2"></div>
<div id="summary2">
<a data-bind="text: 'anchor-text-replaced', click: function(data, event) { alert('anchor clicked!'); }" href="#">anchor-text</a>
</div>
JavaScript
var ViewModel = function() {
var self = this;
self.summarize = function() {
$("#plot1").html($("#summary1").html());
};
};
ko.applyBindings(new ViewModel());