Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

iframe hide div

<html lang="en">
<head>
  <title>Hide element inside iframe using javascript</title>
</head>
<body>
  <p>Click on the <b>Hide Div</b> button to hide the div element inside the iframe.</p>
  <button onclick="hideDiv()">Hide Div</button>

  <iframe id="iframe-id" src="https://search.3schools.in/p/example.html" style="height:370px;width:100%">      </iframe>

<script>
function hideDiv() {
  var myIframe = document.getElementById("iframe-id");
  var divElement = myIframe.contentWindow.document.querySelector("#div");
  divElement.style.display = "none";
}
</script>
</body>
</html>
Comment

html js hide or show iframe

<button id='hideshow'>Link1</button>
<div class="panel">
  <iframe src="linkcodehere" class="content" style="border:0;display:none"></iframe>
  <br/>
  <p class="content" style="display:none;">some stuff</p>
  <p class="content" style="display:none;">more stuff</p>
</div>
<button id="hideshow2">Link2</button>
<div class="panel2">
  <iframe src="linkcodehere2" class="content2" style="border:0; display:none;"></iframe>
  <br/>
  <p class="content2" style="display:none;">some stuff</p>
  <p class="content2" style="display:none;">more stuff</p>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
Comment

html js hide or show iframe

$(document).ready(function(){
  $('#hideshow').on('click', function(event) {        
     $('.content').toggle('show');
  });
});
$(document).ready(function(){
  $('#hideshow2').on('click', function(event) {        
     $('.content2').toggle('show');
  });
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: jest test thunk 
Javascript :: webpack dev srcipt 
Javascript :: react counter animation 
Javascript :: install svelte router 
Javascript :: webdriver-manager node known as a command 
Javascript :: how to trim the file name when length more than 10 in angular 
Javascript :: js comment 
Javascript :: reducer function redux 
Javascript :: js sleep function 
Javascript :: get difference of minutes between two time based on am, pm 
Javascript :: check when input number value goes up or down 
Javascript :: js set value in object only if defined 
Javascript :: res.write image url 
Javascript :: node js download image from url as buffer 
Javascript :: export socket io connection in react 
Javascript :: whatare portals in react 
Javascript :: supertest expect content type 
Javascript :: vscode angular: running ngcc 
Javascript :: mdn .includes 
Javascript :: filter the falsy values out of an array in a very simple way! 
Javascript :: split the string on any and all periods, question mark using regex 
Javascript :: how contvert array to string like implode in jquery 
Javascript :: javascript iterable 
Javascript :: Using the Sanity client without specifying an API version is deprecated 
Javascript :: promise .then javascript 
Javascript :: split text javascript 
Javascript :: add points to numbers js 
Javascript :: jquery clone table row 
Javascript :: phaser aseprite animation 
Javascript :: slice array jas 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =