function copyToClipboard(elementId) {

	/* Get the text field */
	var copyText = document.getElementById(elementId);

	/* Select the text field */
	copyText = copyText.textContent;

	/* Copy the text inside the text field */
	navigator.clipboard.writeText(copyText);

	var tooltip = document.getElementById("myTooltip");
	tooltip.innerHTML = "Copied";

}

function resetCopy() {

  var tooltip = document.getElementById("myTooltip");
  tooltip.innerHTML = "Copy to clipboard";

}

//const clipboard = querySelector('.tooltiptext');
const minecraft = document.getElementById('minecraft-clip');
minecraft.addEventListener('click', copyToClipboard('minecraft-server'));
minecraft.addEventListener('mouseout', resetCopy());
