如何在使用 Datepicker 更改日期时删除 class?

How to remove a class when the date is changed using Datepicker?

我想问一下当用户 select 从 Datepicker

日期时如何删除 class
$('#event-date').keyup(function () {
    $("#errorfieldEventDate").removeClass("has-error");
});

HTML

<div class="form-group" data-bind="fadeVisible: isEventDateVisible">
    <label class="col-md-3 control-label">Event Date:</label>
    <div class="col-md-9">
        <div class="input-group">
            <input type="text" id="event-date" name="event-date" class="date-picker form-control date-picker-view" data-bind="value: eventItem().selectedEventDate" />
            <div class="input-group-addon">
                <span class="icon-info icon-info-calendar"></span>
            </div>
            <div class="input-group-addon">
                <span class="logo logo-required"></span>
                <span class="data required-box" data-bind="visible: isEventDateError"></span>
            </div>
        </div>
    </div>
</div>

你可以收听 changeDate event:

Example Here

$('#event-date').on('changeDate', function (e) {
    $("#errorfieldEventDate").removeClass("has-error");
});