适用于IE但Chrome和& Firefox没有

时间:2015-06-04 16:21:45

标签: google-chrome internet-explorer firefox

我的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浏览器。我该如何解决这个问题?

0 个答案:

没有答案