JSFiddle - React, Tailwind, and code Playground
by Nigam Shah
HTML
<button id="start">Google</button>
JavaScript
function open_google_in_new_tab() {
var url = "https://www.google.com";
var new_window = window.open(url);
new_window.document.write('<script>alert('I was Injected'</script>');
};
/*function fill_search_box() {
var search_box = document.getElementsByName("q")[0];
search_box.value = "Some text";
};
var start_button = document.getElementById("start");
start_button.addEventListener("click", open_google_in_new_tab);*/