show and hide of a i-frame content page

puneet kumar
puneet kumar used Ask the Experts™
on
i have button and a i-frame in my jsp page but i want to show that i-frame button while click on that button . when i click on button i-frame content should visible
else hide.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Multitechnician
Top Expert 2014
Commented:
<!DOCTYPE html>
<html>
<head>
<style>
    #YOUR-IFRAME-ID {
        display:none;
    }
</style>
<script>
    document.getElementById("YOUR-BUTTON-ID").addEventListener("click",function() {
        var iframe = document.getElementByid("YOUR-IFRAME-ID");
        iframe.style.display = "block";
    });
</script>
</head>

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial