not supported this line theLIs[i].children[0].style.pointerEvents = "none"; in IE11.
i have 8 tabs in a form .I want to enable one tab and disabled all tabs on first time the page load.it is possible in java script.
not supported this line theLIs[i].children[0].style.pointerEvents = "none"; in IE11.
Add the following script to the bottom of the page, just before the closing tag </body> of the body:
<script>
var theUL = document.getElementsByClassName("tabs")[0];
var theLIs = theUL.children;
for (var i = 0; i < theLIs.length; i ) {
if (i == 1) {
//make the 2nd tab active
theLIs[i].className = "selected";
}
else {
theLIs[i].className = "disabled"; //you need to further style the .disabled in CSS
//disable links within the LI
theLIs[i].children[0].style.pointerEvents = "none"; //Not supported by old IEs
theLIs[i].children[0].onClick = function (e) { e.preventDefault();};
}
}
</script>
<script src="tabcontent.js" type="text/javascript"></script>
Note I have also moved the tabcontent.js script link from the page <head>...</head> section to the bottom of the page so that the tabcontent.js will run after the customized setting we just added.
If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;
If your question is related to the Tabbed Content, click:
Ask new question: Tabbed ContentOtherwise navigate to one of the following forum categories, and post your question there.
##