OneCompiler

Help with code

91

// The following is the HTML code:

 <!DOCTYPE html>
<html>
  <body>
      <h1 class="title">Game site</h1>
      <script src="script.js"></script>
      <input type="button" id="buttonLocal" onclick="openWindow()" name="open window">
  </body>
</html>
function confirmText(newWindow) {
  let newText = newWindow.document.getElementById('textBoxButton').value
  newWindow.document.write('<p>newText</p>')
  newWindow.document.finish()
}
function openWindow() {
  let newWindow = window.open('about:blank')
  newWindow.document.write('<input type="text" id="textBoxLocal"></input>')
  newWindow.document.write('<script src="script.js"></script>')
  newWindow.document.write('<input type="button" id="textBoxButton" value="<- enter the website" onclick="confirmText(newWindow)"></input>')
}