KnockoutJS
1. 在Table中添加一条新的item,并绑定数据时,按钮的绑定事件应该这样写: HTML: < table id ="tblCountryList" border ="1" class ="tableStyle" > < thead > < tr > < th > Country </ th > < th > State </ th > </ tr > </ thead > <!-- Iterating through every list item using foreach of KO --> < tbody data-bind ="foreach: Countries" > < tr > < td >< input data-bind ="value: CountryName" /></ td > < td >< input data-bind ="value: StateName" /></ td > </ tr > </ tbody > </ table > < br /> < button data-bind ="click: AddCountries.bind($data,'', '', true)" > Add State </ button > JS: $(document).ready(function(){ var