As PointZeroTwo details out inside the responses, the code might be improved so it would return successful/failure outcome. You may see a demo on this jsFiddle. btn'); and it will copy the material of DOM with id toCopyElement to clipboard. This is usually a snippet that copy the text provided https://marioctngt.activosblog.com/38171917/5-easy-facts-about-view-details-described