asp.net - How to focus in div tag in javascript -
i have created tabs using div tag in javascript. have asp.net button on each tab. whenever clicked on button focus set first tab.
i using following code in page load event.
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");
each div have unique id.
on clicking div tab, id of div.
using css style add class active div.
add inactive class other divs.
when click div , remove active class , add class cliked one
Comments
Post a Comment