Call in Javascript function from the body of a webpage

On my website, I have a javascript that randomly opens a website with a crossword puzzle using the following script

<script>
const CWlinks = ["CW001", "CW002", "CW003", "CW004", "CW005", "CW006", "CW007", "CW008", "CW009", "CW010"]

CrossWordNGSL = function () {
	// get a random number between 0 and the number of links
	let randIdx = Math.random() * CWlinks.length;
	// round it, so it can be used as array index
	randIdx = parseInt(randIdx, 10);
	// construct the link to be opened
	let CWlink = './Crossword/NGSL_' + CWlinks[randIdx] + '.html';
	// open it in a new window / tab (depends on browser setting)
	window.open(CWlink);
	};

</script>

In the body of my html document, I have the following code

<a class="links-hidden" onclick="CrossWordNGSL()">CrossWord</a>

Unfortunately, I was asked to give my code to another website and I agreed before I knew it was Wix. I have no idea how to add it to a Wix website, or even if it is possible. Can it be down? Does it require a lot of coding changes?

You can use an HTML Component to add this code. Can read more about them here: Working with the HTML iframe Element