• I need to programatically hide tabs. I am able to hide the content of the tab with the following code:

    function hideTab(formName){

    var currElement = document.getElementById(formName);

    while(currElement.parentElement != null){
    currElement = currElement.parentElement;
    if(currElement.className == ‘wp-tab-content’ ){
    currElement.style.display=”none”;
    break;
    }
    }
    }

    However, the tab label still appears. I tried putting a span tag around the tab title and doing the following but it doesn’t work:

    document.getElementById(“risk factors title”).style.color =’red’;

    I also tried putting a div around the whole tab but, even without the hide function being called, it would not display.

    How can I hide tabs using javascript?

    https://www.ads-software.com/plugins/wp-ui/

  • The topic ‘Can't hide tabs via javascript’ is closed to new replies.