JSFiddle - React, Tailwind, and code Playground

by Alin Guta

HTML

<div id="hehe"></div>
<div id="haha"></div>
<div id="hihi"></div>
<div id="huhu"></div>

<p></p>

JavaScript

var IDs = $("[id]")// find spans with ID attribute
  .not("#hehe")
  .map(function() { return this.id; }) // convert to set of IDs
  .get(); // convert to instance of Array (optional)
  iduri = IDs.join(', ');

$('p').html(iduri);