These are different tabs on my page, clicking one of the tabs takes to that section of the page.
<nav>
<ul>
<li class="tab-current"><a style="color:red" href="#section-1" class="icon-shop"><span>Home</span></a></li>
<li><a href="#section-2" class="icon-cup" id="events"><span>Events</span></a></li>
<li><a href="#section-3" class="icon-food" id="finance"><span>Finance</span></a></li>
<li><a href="#section-4" class="icon-lab" id="merchandise"><span>Merchandise</span></a></li>
<li><a href="#section-5" class="icon-truck" id="tasks"><span>Tasks</span></a></li>
<li><a href="#section-6" class="icon-truck" id="profile"><span>Profile</span></a></li>
</ul>
</nav>
<section id="section-2" onclick="setTabIndex(2)">
<!-- content here -->
</section>
<asp:TextBox ID="tabu" runat="server"></asp:TextBox>
function setTabIndex(tab) {
//store the tab number in a hidden field so you can access it in code behind
document.getElementById("<% = HiddenField1.ClientID %>").value = tab;
document.getElementById('tabu').value = tab;
}
Textbox to check if value is being set to the textbox on changing the tab. So document.getElementById('tabu').value = tab; should change the textbox value each time a tab is clicked, right? But its not shown in textbox.
What am I doing wrong? Kindly help out. Thanks
innerHTMLalso the nav tag is never closed.