|
There is a dropdownlist,
The javascript is as follows:
function style()
{
var ddl=document.getElementById("DropDownList1");
if(ddl.options[ddl.selectedIndex].value=="style 1")
{
document.getElementById("Label2").innerHTML="<link href=\"stylecss/stylecss.css\" rel=\"stylesheet\" type=\"text/css\" />";
}
else
{
document.getElementById("Label2").innerHTML="<link href=\"stylecss/stylecss1.css\" rel=\"stylesheet\" type=\"text/css\" />";
}
}
My current cs code page pageload has been added: this.DropDownList1.Attributes.Add("onchange", "javascript:style()");
Why is there an error when selecting items? ?
How to write? ? Tell me, brothers. . |
|