我的JavaScript:
var bossId = $('#BossId');
var date = $('#divDate');
var headDate = $('#HeadShipDate');
var select = '-- Select --';
bossId.change(function () {
if ( bossId.find(':selected').text() != select )
date.show();
else {
date.hide();
headDate.val('');
}
});
我的观点:
@Html.DropDownList(
"BossId", null, "-- Select --",
htmlAttributes: new { @class = "form-control" }
)
<div id="divDate" class="form-group" style="display:none">
@Html.EditorFor(
model => model.HeadShipDate,
new { htmlAttributes = new { @class = "form-control" } }
)
根据标题,此脚本在Internet Explorer上运行正常,但在Chrome&amp; Firefox浏览器。我该如何解决这个问题?