Corresponding <DIV> above the active gameMap ?? [SOLVED]

Hi,
[Don't know if this post belongs somewhere else]

with the folloring script (see below) in a CommonEvent
I got this <div> with a text and a link in it ontop of my gameMap - as it should be.
1745110365639.png


But if I click on the link in the <div> nothing happens.
(When I put the code in a HTML-Page then it execute the link "console.log('TEST');")

So it seems that the <div> is not activated.

Does someone know how I can get this <div> activated ❓
At best while the content of the gameMap continues running, just the mouse input is used for this <div> ❓

Kindest regards

Nafraju


JavaScript:
const outerDiv = document.createElement("div");
const textInputForm = document.createElement("div");
outerDiv.id = "outerDiv";
textInputForm.id = "textInputForm";
outerDiv.appendChild(textInputForm);
document.body.appendChild(outerDiv);

textInputForm.innerHTML = `
<body style="background-color: rgb(253, 251, 251)">
<div id="textInputField" align="center">
<span id="Argument">The truth is:</span><a href="console.log('TEST');" id="TargetArgument"><font color="#880088">TEST IST FALSCH</font></a>
</div>
</body>`;

-
the <div> is more like a container.

to make links, you need <li><a href="#link">linkname</a> </li>

than it can work, otherwise it cannot.
you can google it otherwise as I do html Manipulation on some plugin making 😉

my menu manipulate them in a clean way. but different than yours.
Should be like this:
href="JavaScript:console.log('TEST');"
@ShadowDragon & @utunnels

The link I did is correct:
1745154542112.png

because in a normal webpage it works.

The issue is that here the <div> is over the active gameMap of the maker (as it should be),
but the mouse/tuoch-input only works for the gameMap but not for this <div>.

So I need a script/command/way to activate this <div> for the mouse/touch-input.

.
Are you sure? Because I tried on MZ's playtest it definitely didn't work. The page jumped to the url console.log.... which is not found.
Maybe some browsers recognize it as a valid javascript, but it is not the correct way to do.
1745155349850.png
Are you sure? Because I tried on MZ's playtest it definitely didn't work. The page jumped to the url console.log.... which is not found.
Maybe some browsers recognize it as a valid javascript, but it is not the correct way to do.
View attachment 338158
Do you have it over the active gameMap ?

Because with me there happens nothing - no jumping to url - no anything.
Only the Player moves over the map.
JavaScript:
const outerDiv = document.createElement("div");
const textInputForm = document.createElement("div");
outerDiv.id = "outerDiv";
textInputForm.id = "textInputForm";
outerDiv.appendChild(textInputForm);
document.body.appendChild(outerDiv);
outerDiv.style.zIndex = 999;
outerDiv.style.position = 'absolute';
textInputForm.innerHTML = `
<div id="textInputField" align="center">
<span id="Argument">The truth is:</span><a href="javascript:console.log('TEST');" id="TargetArgument"><font color="#880088">TEST IST FALSCH</font></a>
</div>`;
Youcan try this one.
JavaScript:
const outerDiv = document.createElement("div");
const textInputForm = document.createElement("div");
outerDiv.id = "outerDiv";
textInputForm.id = "textInputForm";
outerDiv.appendChild(textInputForm);
document.body.appendChild(outerDiv);
outerDiv.style.zIndex = 999;
outerDiv.style.position = 'absolute';
textInputForm.innerHTML = `
<div id="textInputField" align="center">
<span id="Argument">The truth is:</span><a href="javascript:console.log('TEST');" id="TargetArgument"><font color="#880088">TEST IST FALSCH</font></a>
</div>`;
Youcan try this one.

You are right.
I need to have javascript:console.log('TEST');
but the testing before (at you mentioned it the firsttime) couldn't work,
because I had the zIndex at 10 and not at zIndex = 999;

THANK YOU - VERY VERY MUCH ❣️

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/corresponding-div-above-the-active-gamemap-solved.177085/