Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function createButton(func) {
  3.     var wrapper = document.getElementsByClassName('mt-5')[0];
  4.     var context = wrapper.getElementsByClassName('col-4')[1];
  5.     var button = document.createElement("input");
  6.     button.type = "button";
  7.     button.value = "open";
  8.     button.onclick = func;
  9.     wrapper.appendChild(button);
  10. }
  11.  
  12. window.onload = function() {
  13.     createButton(function() {
  14.         var url = document.getElementsByName('start-url')[0].value;
  15.         window.open(url)
  16.     });
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement