copyResult.jsp 627 B

123456789101112131415161718192021222324252627
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <style>
  4. .copyResult {
  5. color: red;
  6. font-size: 16px;
  7. font-weight: bold;
  8. margin-left:50px;
  9. }
  10. </style>
  11. <script>
  12. function copyResult(){
  13. var e=document.getElementById("span_result");//对象是content
  14. if (e.value != "") {
  15. e.select();//选择对象
  16. document.execCommand("Copy");//执行浏览器复制命令
  17. }
  18. }
  19. function copyBz(){
  20. var e=document.getElementById("bz_result");//对象是content
  21. if (e.value != "") {
  22. e.select();//选择对象
  23. document.execCommand("Copy");//执行浏览器复制命令
  24. }
  25. }
  26. </script>