Javascript 如何仅在pdf中打印我的文本区域而不是整个页面 text任何图像 复制歌词函数copyhtml(){const text=document.querySelector(“#htmlText”);const btnText=document.querySel
如何仅在pdf中打印我的文本区域而不是整个页面Javascript 如何仅在pdf中打印我的文本区域而不是整个页面 text任何图像 复制歌词函数copyhtml(){const text=document.querySelector(“#htmlText”);const btnText=document.querySel,javascript,html,printing,textarea,Javascript,Html,Printing,Textarea,如何仅在pdf中打印我的文本区域而不是整个页面 text任何图像 复制歌词函数copyhtml(){const text=document.querySelector(“#htmlText”);const btnText=document.querySelector(“#htmlBtn”);text.select();document.execCommand(“Copy”);btnText.textContent=“Copied”;setTimeout(函数(){btnText.textCont
text任何图像
复制歌词函数copyhtml(){const text=document.querySelector(“#htmlText”);const btnText=document.querySelector(“#htmlBtn”);text.select();document.execCommand(“Copy”);btnText.textContent=“Copied”;setTimeout(函数(){btnText.textContent=“复制歌词”},5000);}
你好,请告诉我们您正在尝试什么样的东西,以便我们能更好地帮助您。A将是最好的!
<textarea cols="100" id="htmlText" readonly="" rows="50" style="background-color: #ffff4d; border-color: BLACK; border-radius: 10px; border: 4px solid black; color: black; font-size: 1em; font-weight: bold; height: auto; overflow: hidden; resize: none; text-align: center; width: 98%;"> TEXTany images
</textarea><button id="htmlBtn" onclick="copyhtml()" style="background-color: #0b5394; border-color: rgb(243, 243, 243); border-radius: 1000px; box-shadow: rgb(0, 255, 0) 0px 4px; color: white; cursor: pointer; display: inline-block; font-size: 20px; margin: 40px 50px; padding: 20px 50px; text-align: center; text-decoration: none;">Copy Lyrics</button><script> function copyhtml() { const text = document.querySelector("#htmlText"); const btnText = document.querySelector("#htmlBtn"); text.select(); document.execCommand("Copy"); btnText.textContent = "Copied"; setTimeout(function(){ btnText.textContent = "Copy Lyrics"; }, 5000); }</script>