yes you can give id atrubute to a bubble element and show it into an codex,cursor written ui code (which is in a html element)
just tested it and worked
put an mutlifile uploader element into your page and give it an id atribute. we used “uploader1” for this code.
then put this code into and html element and you will see that element into this place not at where you put it.
<div id="uploader-host"
style="border:1px solid #E5E7EB;border-radius:12px;padding:12px;background:#FFF;">
<div style="font:600 13px system-ui;color:#0F172A;margin-bottom:8px;">
Uploader burada render edilecek
</div>
<!-- Bubble elementini bunun içine taşıyacağız -->
<div id="uploader-slot"></div>
<div id="uploader-status"
style="margin-top:10px;font:12px system-ui;color:#64748B;">
Bekleniyor…
</div>
</div>
<script>
(function () {
// Bubble'da verdiğin uploader ID'si
var TARGET_ID = "uploader1";
// Bubble bazen elementleri geç render eder; birkaç kez deneyeceğiz.
var MAX_TRIES = 30; // 30 * 250ms = 7.5s
var tryCount = 0;
function setStatus(msg) {
var el = document.getElementById("uploader-status");
if (el) el.textContent = msg;
}
function moveUploader() {
tryCount++;
var uploader = document.getElementById(TARGET_ID);
var slot = document.getElementById("uploader-slot");
if (!slot) {
setStatus("Hata: uploader-slot bulunamadı.");
return;
}
if (uploader) {
// Elementi taşı (appendChild DOM'da move eder)
slot.appendChild(uploader);
// Görsel ufak düzen
uploader.style.width = "100%";
setStatus("✅ Uploader bulundu ve wrapper içine taşındı (ID: " + TARGET_ID + ").");
return; // tamam
}
if (tryCount < MAX_TRIES) {
setStatus("Uploader aranıyor… (" + tryCount + "/" + MAX_TRIES + ") ID: " + TARGET_ID);
setTimeout(moveUploader, 250);
} else {
setStatus("❌ Uploader bulunamadı. ID doğru mu? (Beklenen: " + TARGET_ID + ")");
}
}
// DOM hazır olunca başla
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", moveUploader);
} else {
moveUploader();
}
})();
</script>