我在使用淘汰赛 js 时遇到问题。这里我使用的是可观察数组,其中属性名称 selectedItem 与单选按钮选中属性绑定。当我更改任何选项时,我想要单击的先前值和当前值。
<div style="font-size: 11px; line-height: 1.28; margin-left: 5px; margin-top: 10px;"
data-bind="foreach:OptionDetail">
<div>
**<input type="radio" class="mts" style="float: left; margin-left: 5px" data-bind="attr:{name:ParentCourseItemID,value:OptionDescription},click:function($root,event){SaveOptionForPoll($root,Option,SelectedItemID)},checked:SelectedItemID" />**
</div>
<input type="hidden" data-bind="attr:{id:'hdnSelectOption'+CourseItemID}" />
<div data-bind="event: { mouseover: $root.ShowVoteCount, mouseout: $root.HideVoteCount }" style="margin-bottom: 5px; border: 1px solid #CCC; background-color: white;
zoom: 1; float: left; width: 210px; margin-left: 5px; height: 25px;">
<div style="text-align: left; float: left; margin-top: 5px; margin-left: 5px;" data-bind="html:OptionDescription">
</div>
<div style="float: right; display:none; width: 50px; background-color: yellow; height: 52%; padding: 6px;"
data-bind="attr:{id:'poll'+CourseItemID}">
<span style="margin-right:5px;" data-bind="text:VoteCount"></span>Votes
</div>
</div>
<div style="padding-left: 5px; padding-right: 5px; height: 100%">
<span style="position: relative; top: 4px"></span>
</div>
</div>