I have a page that has a hidden button at the top. When a link is clicked, the button shows. I want to write javascript so that if the button is showing, add a breakline below it and if it is not showing, do nothing. My attempt & fail is below. Can someone shed some light?
<input type="button" id="listframes" value="Button" />
<script type="text/javascript">
//If the button is showing, then break line below it.. else do nothing
var ButtonID = document.getElementById('listframes');
if(ButtonID.style.display == 'block')
{
document.writeln('<br /> \r\n');
}
</script>
<iframe id="external_frame" name="ExternalFrame" frameborder="0" scrolling="auto" marginwidth="0" marginheight="0"></iframe>
#listframes {
display: none;
}