function getPageIdFromUrl(a) { let e = a.match(/page-(\d+)/); return e ? parseInt(e[1]) : (console.warn("Page ID not found in the URL"), null); } document.addEventListener("DOMContentLoaded", function () { const url = window.location.href, pageId = getPageIdFromUrl(url), nationalDay = document.querySelector(".app-inner"); if (pageId === 2004068726) { nationalDay.classList.add("national-day"); let a = document.querySelector(".content--single-page"), e = document.getElementById("app"); e.classList.add("national"); let r = document.createElement("div"); r.classList.add("fixedOrder"); r.innerHTML = ` اطلب الان `; // Ensure this replaces the existing innerHTML instead of appending. a.innerHTML = `
Image 1 description Image 1 description
`; a.appendChild(r); // Appends the fixedOrder div after setting the innerHTML } }); function removetext() { var element = document.querySelector('.app-inner'); function removeUnwrappedTextNodes(element) { Array.from(element.childNodes).forEach(node => { if (node.nodeType === Node.TEXT_NODE && node.textContent.trim().length > 0) { node.remove(); } }); } if (element) { removeUnwrappedTextNodes(element); } } document.addEventListener('DOMContentLoaded', removetext() ); document.addEventListener("DOMContentLoaded", function () { // حدد العنصر المستهدف بالنص "كل المنتجات" var el = document.querySelector('p.text-sm'); if (el && el.textContent.trim() === "كل المنتجات") { // إنشاء عنصر رابط var link = document.createElement('a'); link.href = "https://drrbsa.com/%D9%83%D9%84-%D8%A7%D9%84%D9%85%D9%86%D8%AA%D8%AC%D8%A7%D8%AA/c64192223"; link.target = "_blank"; // لفتح الرابط في تبويب جديد link.style.textDecoration = "none"; // إزالة الخط السفلي // نقل

داخل el.parentNode.replaceChild(link, el); link.appendChild(el); } });