hello every one i have used the below code but not working i want to copy xmp date with button please help
<xmp id="content"style="background-color: #eff0f1; color: #7d2727; font-size: 16px; font-family: Arial, Helvetica, sans-serif;">
44444jjjjj
</xmp>
<input type="button" id="copyID" value="Copy" />
<script type="text/javascript">
var button = document.getElementById("copyID"),
xmp = document.getElementById("content");
button.addEventListener("click", function(event) {
event.preventDefault();
xmp.select();
document.execCommand("copy");
});
</script>
</body>
</html>