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

129
Views
Can you make JSDoc work in HTML when embeding JavaScript code?

Some backstory: I am working on a .html file where I solve some JavaScript exercises. I write the exercise description as html where I also have a table with example inputs and their corresponding outputs. Then I have created a form which takes an output and by clicking a button the output appears. Inside the form tags I embed the script where I have several functions.

I have found about JSDoc and manage to display function documentation when using it in the .js file but when I use the function in the .html file nothing happens. I am using VSCode and when starting to write the function name it doesn't even pop in the auto-suggestion.

Here is my .html code:

<form>
                    <label>Input: </label>
                    <input type = text id="input3">
                    <label> Output:</label>
                    <input type = text id="output3">
                    <br><br>
                    <button type="button" onclick=addRem()>Get output</button>
                    <script src="utils_for_jsExcercises.js"></script>
                    <script>
                        function addRem() {
                            const input = parseArray("input3");
                            const init = 1;
                            let output = [];
                            let current = init;
                            for (let i=0; i<input.length; i++) {
                                switch(input[i]) {
                                    case "add": {
                                        output.push(current);
                                        current += 1;
                                        break;
                                    }
                                    case "remove": {
                                        output.pop();
                                        current +=1;
                                        break;
                                    }
                                }
                            }
                            if (output.length === 0) {
                                console.log("Empty");
                                
                            }
                            else console.log(output);
                            

                        }
                        
                    </script> 
</form>

And my .js file:

 /**
 * Does stuff
 * @param {sting} outputString
 * @param {string} outputID 
 */
function printOutput(outputString,outputID) {
    let output=document.getElementById(outputID);
    output.value = outputString;

}

Is it possible to make JSDoc work in the .html file or at least the auto-suggestion for the function name?

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!