How can i make iframes show hide when button is clicked?

I have 2 iframes and i would like to show hide them when i click on buttons, i have the jquery working but i have to change it to javascript because of some browser issues. What javascript code can i use to accomplish this, i have tried different methods but i can't seem to make it work. I am not very proficient wih javascript yet and any help or suggestion would be greatly appreciated. Thank You.
iframe.txt
ozzy tDeveloper/Health InformaticsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zc2Commented:
Take a look at this code. Note, the iframe elements now have id attribute. Also I put the iframe size attributes inside the style attribute.
<div class="panel1">
<iframe id="content" class="content" src="<?php echo get_trusted_url('tabadmin','mainreportsvr:8000','views/MasterProviderDailyProductivity/Story1')?>"
style="width:1500px; height:800px; border:0;display:none" >
</iframe> 
 </div>


<div class="panel2">
<iframe id="content2"  class="content2" src="<?php echo get_trusted_url('tabadmin','mainreportsvr:8000','views/MasterSiteDailyProductivity-copy/Story1')?>"
  style="width:1500px; height:800px; border:0;display:none" >
</iframe>  
</div>

 <script type="text/javascript">

window.addEventListener("load", function(){
  document.getElementById("hideshow").addEventListener("click", function(){
      var st = document.getElementById("content").style;
      if( st.display == "block" )
          st.display = "none";
      else if( st.display == "none" )
          st.display = "block";
    });
  document.getElementById("hideshow2").addEventListener("click", function(){
      var st = document.getElementById("content2").style;
      if( st.display == "block" )
          st.display = "none";
      else if( st.display == "none" )
          st.display = "block";
    });
});
</script>

Open in new window


jQuery is a quite good library. If it has issues with some environment, it's better to solve the issue somehow rather than not use it.
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ozzy tDeveloper/Health InformaticsAuthor Commented:
Thank you i appreciate you taking time to help me with this!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.