you can use this:
HTML:
<button id="myButton" onclick="sbButtonClick()">submit</button>
JavaScript:
const textarea = document.getElementById("email");
let myUrl = null;
function sbButtonClick() {
myUrl = new URL(`something.com?searchText=${textarea.value}&site=something&mobileVersion=&locale=&forceAaaApplication=`);
// do something with myUrl
}
Edit
to get multiple email addresses one of the easiest ways is this way:
const textarea = document.getElementById("email");
function sbButtonClick() {
// split the text by line breaks so each address should be in a separate line
const emailArray = textarea.value.split("\n");
// here you open tab for each email address
for (let address of emailArray) {
window.open(`something.com?searchText=${address}&site=something&mobileVersion=&locale=&forceAaaApplication=`);
}
}