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

222
Views
i have html code with JS in it, i have a problem that the submit button not giving me an alert window, can you correct my code?

this is part of my code:

Degree:

                <script>
                    function F2(){
                        var y = document.getElementById("dd");
                            if (y>=73){
                            window.alert("Your degree is less then required");
                            }
                    }
                </script>

it's in a form, i hope someone help me in my code.

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

0

You forgot to add .value at "y" initialization so you are assigning not value of input field, but the whole field

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>test</title>
</head>
<body>
    <button onclick="F2();">Button</button>
    <input id="dd">
</body>
<script>
    function F2()
    {
        var y = document.getElementById("dd").value;
        if (y >= 73)
        {
            window.alert("Your degree is less then required");
        }
    }
</script>
</html>

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!