I have the following piece of code where I want to dynamically hide or show div tag having a component on click of a button.. How can we achieve this?
<apex:page sidebar="false" title="Article List" >
<style>
td{
vertical-align : top;
text-align: left;
}
</style>
function hideshow(which){
if (!document.getElementById)
return
if (which.style.display=="block")
which.style.display="none"
else
which.style.display="block"
}
<apex:form >
<apex:pageBlock title="Article List" >
<apex:panelGrid width="100%">
<table width="99%">
<tr>
<th width="33%">Title</th>
<th width="33%">Article Type</th>
<th width="33%">Summary</th>
</tr>
</table>
<knowledge:articleList articleVar="article" hasMoreVar="false" pageSize="10">
<table width="99%">
<tr>
<td width="33%">
<apex:outputLink target="theIframe" value="{!URLFOR($Action.KnowledgeArticle.View,
article.id,['popup' = 'false'])}">{!article.title}</apex:outputLink>
</td>
<td width="33%"><apex:outputText >{!article.articleTypeLabel}</apex:outputText></td>
<td width="33%"><apex:outputText >{!article.summary}</apex:outputText></td>
</tr>
<tr>
<td>
<a href="javascript:hideshow(document.getElementById('article'))">Click Here</a>
<div id="article" style="font:24px bold; display: none">
<c:articleComp articleId="{!article.articlenumber}" />
</div>
</td>
</tr>
</table>
</knowledge:articleList>
</apex:panelGrid>
<apex:commandButton value="Submit"/>
</apex:pageBlock>
</apex:form>
</apex:page>