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

93
Views
No displays from array object

After I add name value from textbox, and then name value didn't display on webpage and it just display [object Object][object Object], I tried converting from objects to string but don't solve problem.

document.getElementById("test").innerHTML = obj.toString(); -> don't work.

Check all my code at below:

<script>

       const obj = 
       [{
        iname: "",
        iprice: ""
       }];

    function btn()
    {
               
                var name = document.getElementById('Iname').value;
                var price = document.getElementById('Iprice').value;

                obj.push({
                    iname: name,
                    iprice: price
                });

                document.getElementById("test").innerHTML = obj;
    }

    </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try this

document.getElementById("test").innerHTML = JSON.stringify(obj);

It's what I use to debug objects

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!