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

197
Views
I have read a json file & have output it as checkbox in Javascript.if i click on 5 checkboxes alert message should come as 5 checkboxes are clicked
function loadajax() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var response=JSON.parse(this.responseText);
var output="";
for(var i=0;i<response.length;i++){
if(response[i].completed==true){
output+= '<input type="checkbox" id="check" checked name="title" value=" <br>+  response[i].title  ; +" >' + response[i].title + '<br></input>';}
else{
output+= '<input type="checkbox" id="check"  name="checkbox" value=" <br>+  response[i].title  ; +" >' + response[i].title + '<br></input>';   }}
document.getElementById("demo").innerHTML=output;
xhttp.open("GET", "https://jsonplaceholder.typicode.com/todos", true);
xhttp.send();   }

The function loadajax is called in another html file in body onload..if i click on 5 checkboxes alert should come as 5 boxes are checked using the concept of promise.. Please help.

about 4 years ago · Santiago Trujillo
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!