Javascript is not working

Hello i have website and i have one problem, the javascript is not working i dont know why So can anyoune help me please. My website is: rinikplex.gq

Can you check your browser console for any JavaScript errors? What is the JavaScript used for on your site. Do you use any JavaScript APIs? Please give more detail if you would like us to help you.

2 Likes

JavaScript is not working on your site because you don;t have any. There’s no JavaScript.

2 Likes

There is rinikplex.gq/password_page_protected/ in that folder

This is showing that js/index.js does not exist.


image

3 Likes

but its not in js folder

So where is it located? We can’t help if you don’t provide any detail.

1 Like

rinikplex.gq/password_page_protected/index.js
and here is the html code:

Page Is Protected by Password!

Page Protected

Password:

Your webpage is trying to load /password_page_protected/js/index.js not /password_page_protected/index.js and this is why it’s not working.
image

2 Likes

sorry i mean this one <script src="js/index.js" charset="utf-8"></script>

oh ok im going to edit this

You are trying to load a non-existent file with that code.

OK!

1 Like

But the Javascript code is not working

That’s because you never actually call the passcheck() function.

1 Like

But im programming this with youtube tutorial

Are you sure you followed it? Because it would work if you changed your <form> from this:

<form class="passform" action="webpage.html">
       Password: <input type="password" required="" id="pass1">
        <input type="submit">
    </form>

to this:

<form class="passform" onsubmit="passcheck()" action="webpage.html">
       Password: <input type="password" required="" id="pass1">
        <input type="submit">
    </form>

Notice the onsubmit="passcheck()"!

2 Likes

yeah but its says Wrong Password, Try Again. and Correct Password. Click OK to enter Webpage. if i click Submit

You may not want to use JavaScript to check a password, it is super insecure. Consider using PHP, because it is available to you here.

Also, we are not here to solve simple errors on your site over and over again. As a developer, you should at least have those basic debugging skills.

3 Likes

Ok Thanks Have Nice New Year

3 Likes

Another reason why you will have problems is that you do not follow the HTML structure

you have several open/closed elements
and a bunch of others listed in the wrong sections

4 Likes