开发者

how to toggle div inside update panel using javascript. asp.net

Hi I have a dropdownlist and a div inside update panel. I want to togg开发者_Go百科le div using javascript on dropdownlist selection change that is inside update panel. but it is not working.

function DistrictChange() {
        debugger;
        var ddldistrict = document.getElementById('<%=DDLDistrict.ClientID %>');
        var dvOther = document.getElementById('<%=divOthrDistrict.ClientID %>');
        if (ddldistrict.options[ddldistrict.selectedIndex].text == 'Other') {
            dvOther.style.display == 'block';

        }
        else {
            dvOther.style.display == 'none';
        }

    }    


The problem is this line of code :

dvOther.style.display == 'none'; 

== is compare statement.

Use this for assignment :

dvOther.style.display = 'none'; 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜