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

133
Views
How to make a Button thats gives output the Selected Seats Array

How to make a button that takes all the selected seats(By Class Name .selected) and return the id's of them in an array. Example:Cinema

I try this but doens't work for multi seats,1 by 1 only.

 const tick = document.querySelector(".row__seat--selected").dataset.tooltip;
console.log(tick);

//Stringify the Array
const myJSON = JSON.stringify(tick);
console.log(myJSON);
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

you need to use different selector - document.querySelectorAll()

const nodeList = document.querySelectorAll('.selected');
console.log([...nodeList].map(i => i.attributes.id.value))
<div class="selected" id='first'>1 selected</div>
<div class="not-selected">not selected</div>
<div class="selected" id='second'>2 selected</div>
<div class="not-selected">not selected</div>
<div class="selected" id="third">3 selected</div>

about 4 years ago · Juan Pablo Isaza Report

0

var elementIDs = Array.prototype.map.call(document.querySelectorAll('.row__seat--selected'),
function (cookie) {return cookie.id;});
console.log(elementIDs);
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!