function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Deepak ChouhanDeepak Chouhan 

show & hide apex:outputPanel on html button click

Hi,

I am using three html buttons like

<button type="button" class="btn btn-primary" id="btnperson" value="person" >Person</button>                           
<button type="button" class="btn btn-primary" id="btnbusiness" value="business">Business</button>
<button type="button" class="btn btn-primary" id="btnvisit" value="lastvisit">Last Visit</button>

into VF page and i want to show & hide apex:outputPanel on button click.


Regard's
Deepak

Best Answer chosen by Deepak Chouhan
SarfarajSarfaraj
<apex:page >
    <script>
        function hideContent()
        {
            document.getElementById("{!$Component.content}").style.display="none";
        }
    </script>
    <apex:outputPanel id="content">
        content goes here
    </apex:outputPanel>
    <button onclick="hideContent()" value="hide">Hide</button>
</apex:page>