מחולל דפי HTML

סמן קטע טקסט כדי להחיל עליו את גופן רש"י
תצוגה מקדימה
קוד HTML מלא
`; htmlOutput.value = fullHTML; } /* * כפתור החלת גופן רש"י. */ document .getElementById("rashiButton") .addEventListener( "click", function () { const start = inputText.selectionStart; const end = inputText.selectionEnd; if (start === end) { alert( "יש לסמן קודם קטע טקסט." ); return; } /* * שמירת המיקום המדויק של הבחירה. */ rashiRanges.push({ start: start, end: end }); selectionInfo.textContent = 'הקטע שסומן יוצג בגופן רש"י'; createPage(); } ); /* * כפתור יצירת הדף. */ document .getElementById("createButton") .addEventListener( "click", function () { createPage(); } ); /* * כפתור העתקת קוד ה־HTML. */ document .getElementById("copyButton") .addEventListener( "click", async function () { /* * מוודא שהקוד מעודכן * לפני ההעתקה. */ createPage(); try { await navigator.clipboard.writeText( htmlOutput.value ); this.textContent = "הקוד הועתק ✓"; setTimeout( () => { this.textContent = "העתק קוד HTML"; }, 2000 ); } catch (error) { /* * גיבוי לדפדפנים שאינם מאפשרים * navigator.clipboard. */ htmlOutput.focus(); htmlOutput.select(); document.execCommand("copy"); this.textContent = "הקוד הועתק ✓"; setTimeout( () => { this.textContent = "העתק קוד HTML"; }, 2000 ); } } );