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

239
Views
Web browser console is printing the <js file linked to HTML> output but the text editor is not

I have linked CSS and JS files to HTML file and working to create a website. I have added an onclick attribute and assigned a function INCREMENT that just displays "the button was clicked".

Here's the code snippet:-

You can run it also...

// js script

function increment()
{
    console.log("The button was clicked");
}
  /* CSS code*/

body{
    background-image: url("station.jpg");
    background-size: cover;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: bold;
    text-align: center;
}

h1{
    font-size: 60px;
    margin-top: 10px;
    margin-bottom: 10px;
}

h2{
    font-size: 60px;
    margin-top: 0;
    margin-bottom: 20px;
}

button{
    border: none;
    font-size: x-large; /* own attributes use */
    padding-top: 10px;
    padding-bottom: 10px;
    color:white;
    font-weight: bold;
    width: 250px;
    margin-bottom: 5px;
    border-radius: 10px;
}

#increment-btn{
    background:green;
}
#save-btn{
    background: darkblue;
}
<!-- HTML code-->

<html lang="en">
    <head>
        <link rel="stylesheet" href="index.css">
    
    </head>
    <body>
        <h1>People Entered:</h1>
        <h2 id="count-el">0</h2>

        <!-- Creating an increment button with id="count-el"-->

        <button type="button" id="increment-btn" onclick="increment()">INCREMENT</button>
        
      
   

        <script src="index.js"></script>
    </body>
</html>

Now my problem is that **when I click on the INCREMENT button on my webpage I don't see the "button was clicked" output on my text editor vs code, it just says

[Done] exited with code=1 in 0.094 seconds

but if I go to my webpage and inspect it and open the console there I can see my message "button was clicked". Is this really a problem or its just working fine and the problem is with my vs code setup? Am I confusing between things here, cause I am really new to this and just know the basics. Please help me out...

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