Hello i am just building a website for a FiveM Server. It has an button on it which is actually an li element and if you click it FiveM should locally open and connect to the Server with this Link fivem://connect/nextroleplay.de:30120. This works.
Because of that the Button is an li element i tried following with onclick
<li class="nav-link playnow" onclick="location.href='fivem://connect/nextroleplay.de:30120">
<a href="#">
<i class='bx bx-play icon' ></i>
<span class="text nav-text">JETZT SPIELEN</span>
</a>
</li>
But NOTHING happens. Why?
The "Button" looks like this:
Missing quote check below
<li class="nav-link playnow" onclick="location.href='fivem://connect/nextroleplay.de:30120'">
<a href="#">
<i class='bx bx-play icon' ></i>
<span class="text nav-text">JETZT SPIELEN</span>
</a>
</li>
You can create a Javascript function and then use that function in "onclick" event like below. Check this once.
function navigate() {
location.href = "fivem://connect/nextroleplay.de:30120";
}
<li class="nav-link playnow" onclick="navigate()">
<a href="#">
<i class=' bx bx-play icon'></i>
<span class="text nav-text">JETZT SPIELEN</span>
</a>
</li>