Copy to clipboard is working on Chrome, Firefox browser on both mobile and desktop. But not working on MI browser and DuckDuckGo Browser(Mobile Browsers).
Here is my js code
<script>
//copy
$(document).ready(function(){
$(document).on("click",".copy_link", function(){
var copyText = $(this).data('id');
navigator.clipboard.writeText(copyText);
})
})
</script>
And here is my HTML code
<button class="copy_link" data-id="https://msort.ml/<?php echo $row['link']; ?>" >Copy</button>
I've tried other methods but I didn't get another method to copy from .class
.
Here is my website snapshot