Having this iFrame API script appear upon button click

I have been testing this script:

<script src='https://meet.jit.si/external_api.js'></script>

<div id="meeting"></div>

const options = {
    parentNode: document.querySelector('#meeting'),
    width: "100%",
    height: "100%",
    onload: {window.onload = function()

meetAPI = new JitsiMeetExternalAPI("meet.jit.si", options);

I’d like to try to have it appear upon click. I tried unsuccessfully to integrate that code with the example here:

which shows:

<button onclick="myFunction()">Try it</button>

function myFunction() {
  var x = document.createElement("IFRAME");
  x.setAttribute("src", "https://www.w3schools.com");

any help with properly integrating the w3schools code with the iFrame api is appreciated

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.