I am providing you and example for toggling your div but you can use this approach for only show/hide.
For example you have a Div within MasterPage like the following:
<div id="myDivBox" style="display:none; width :300px">
For hiding and showing your div dynamically via JavaScript. This content will toggle.
</div>
And you have a Button within Child Page which inherits that MasterPage:
<asp:button id="button1" runat="server" onclick="toggleDiv()" />
Now write the following scripts within ContentPlaceHolder:
<script language="javascript" type="text/javascript">
function toggleDiv()
{
if (document.getElementById("myDivBox").style.display == "block")
{
document.getElementById("myDivBox").style.display = "none";
}
else
{
document.getElementById("myDivBox").style.display = "block";
}
}
</script>
For further detail please navigate the following links:
Show hide div on button click without postback
How to hide, show, or toggle your div
You will find more examples on Google.