- Messages
- 110
- Reaction score
- 0
- Points
- 26
Need help guys with my code. Sinusubukan ko kase gumawa ng template na web based instead na sa notepad namin ginagamit yung mga information. Hindi ko mapagana yung multiple text input para mag copy to clipboard. Laging yung isang element lang ang na ccopy, yung pangalawa ayaw na.
<input type="text" id="unique" size="9" value ="SESA / D-ID:" readonly/>
<input type="text" id="unique" size="18" value="">
<button id="copybtn" onclick="doCopy()"> Copy to clipboard </button>
<script type="text/javascript">
function doCopy() {
var unique = document.getElementById('unique');
unique.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
console.log("Text Copy Was "+message);
}
catch(err) {
console.log("There was an error copying");
}
}
</script>
<input type="text" id="unique" size="9" value ="SESA / D-ID:" readonly/>
<input type="text" id="unique" size="18" value="">
<button id="copybtn" onclick="doCopy()"> Copy to clipboard </button>
<script type="text/javascript">
function doCopy() {
var unique = document.getElementById('unique');
unique.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
console.log("Text Copy Was "+message);
}
catch(err) {
console.log("There was an error copying");
}
}
</script>