Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
onclick an <li> to open local redirect

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:

Button

Menu

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

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>
about 4 years ago · Juan Pablo Isaza Report

0

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>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!