Javascript Copy Function
<body>
<body>
    <h2 id="title">Copy to Clipboard - JavaScript - dcode</h2>
    <h2 id="title">Copy to Clipboard - JavaScript - dcode</h2>
    <input id="myInp" type="text">
    <input id="myInp" type="text">
    <button id="btnCopy">Copy</button>
    <button id="btnCopy">Copy</button>
</body>
</body>
<script type="text/javascript">
<script type="text/javascript">
    const myInp = document.getElementById("MyImp");
    const myInp = document.getElementById("myInp");
    const btnCopy = document.getElementById("btnCopy");
    const btnCopy = document.getElementById("btnCopy");
    btnCopy.onclick = function () {
    btnCopy.onclick = function () {
        // Step 1 - Select the text
        // Step 1 - Select the text
        myInp.select();
        myInp.select();
        // Step 2 - Copying the text
        // Step 2 - Copying the text
        document.execCommand("Copy");
        document.execCommand("Copy");
    };
    };
<`/script>
</script>