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

105
Views
input.type = "number"; but only for specific input field

How I can use my : input.type = "number"; to be used only in specific fields?

            var cell1 = row.insertCell(0);
            var cell2 = row.insertCell(1);
            var cell3 = row.insertCell(2);
            var cell4 = row.insertCell(3); 

I have these inserts, to insert fields into the table. So how can I specify only for the eg. Cell(0)? To have only numbers (0-9) in the specific fields.

Sorry if sounds stupid. Thank you

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

0

Currently you only create a cell. To add a input field you simply create one (as shown below) and append it to your cell like this:

const input = document.createElement('input');
      input.setAttribute('type', 'number'); 
      input.setAttribute('min', 0); 
      input.setAttribute('max', 9); 

cell1.appendChild(input)

Some resources for you to learn about all this:

  • https://www.w3schools.com/tags/att_input_min.asp
  • https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement

I hope this helps ;)

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!