我已经在javascript中使用div标记创建了一个选项卡。我在每个选项卡上都有asp.net按钮。每当我点击按钮的焦点设置为第一个选项卡。如何在JavaScript中关注div标记
我在页面加载事件中使用以下代码。
HtmlGenericControl content_1 = new HtmlGenericControl("content_1");
HtmlGenericControl content_2 = new HtmlGenericControl("content_2");
HtmlGenericControl content_3 = new HtmlGenericControl("content_3");
HtmlGenericControl content_4 = new HtmlGenericControl("content_4");
HtmlGenericControl content_5 = new HtmlGenericControl("content_5");
HtmlGenericControl selectedPage = new HtmlGenericControl(pageName);
content_1.Style["display"] = "none";
content_2.Style["display"] = "none";
content_3.Style["display"] = "none";
content_4.Style["display"] = "none";
content_5.Style["display"] = "none";
selectedPage.Style["display"] = "block";
selectedPage.Attributes.CssStyle.Add("class", "active");
编辑和使用编辑器1010这将使得代码更易读。 – zod 2010-10-08 04:11:04
见..高级buddys可以编辑代码..不错 – zod 2010-10-08 04:15:04