I’ve added clipboard.js support, and added contenteditable to certain elements. I used npm install clipboard --save (per guidance) to install clipboard.js, but I have a ‘utils.js’ file (linked in document head), residing outside the root directory, which:
- makes certain elements editable…
- removes ‘contentEditable’ attribute before copy…
- copies text (html)…
- reinstates contentEditable after copy…
- displays
alert("Copied!")
In an effort to make this available and reusable, I’m wondering where to include the utils.js file (code). Any guidance is appreciated.
I’ve added clipboard.js support, and added contenteditable to certain elements. I used
npm install clipboard --save(per guidance) to install clipboard.js, but I have a ‘utils.js’ file (linked in documenthead), residing outside the root directory, which:alert("Copied!")In an effort to make this available and reusable, I’m wondering where to include the utils.js file (code). Any guidance is appreciated.