★Add to favorites

AdSense

2016년 11월 18일 금요일

random background color


Code:

<script>
var bgcolorlist=new Array("#C4AA9E", "#FFFFBF", "#80FF80", "#EAEAFF", "#C9FFA8", "#FFD9FA", "#D1D8FF", "#F361A6")
document.body.style.background=bgcolorlist[Math.floor(Math.random()*bgcolorlist.length)]
</script>

How to show alert message when closing a window?


Code:

<script type="text/javascript">
      window.onbeforeunload = function() {
          return "Are you sure?"
      }
    </script>