The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Make A Button To Copy Text Onto The Clipboard

TODO: Pull subtitle into page object html_start_default_section html_end_default_section script_start_default_section script_end_default_section


Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Make A Button To Copy Text Onto The Clipboard

-- tldr/

-- html/
-- show

<p id="content">
  lima <em>delta</em> november

<button id="copyButton">
  Copy Content

-- /html

-- script/
-- show

const copyContent = async () => {
  try {
    await navigator.clipboard.writeText(
    copyButton.innerHTML = "Copied!"
  } catch (err) {
    console.error("Could not copy to clipboard")

document.addEventListener("DOMContentLoaded", () => {
  copyButton.addEventListener("click", copyContent)

-- /script

-- /tldr

-- notes

- I'm using _innerText__ instead of _innerHTML__
in the copy. Using _innerHTML__ put the tags 
themselves in the output when I posted into
a plain-text editor

-- ref
-- title: MDN: Navigator Clipboard
-- url:

-- ref
-- title: MDN: Navigator Clipboard API
-- url:

-- categories
-- JS 

-- metadata
-- date: 2022-03-14 23:10:14
-- id: 26p8miod
-- status: draft 
-- type: post
-- site: aws