随机获取颜色

Original 2019-06-07 10:58:11 249
abstract:<div id="box" style="width:100px; height:100px; border:1px solid #000"></div><input id="rndc" type="button&quo

<div id="box" style="width:100px; height:100px; border:1px solid #000"></div>

<input id="rndc" type="button" value="随机变色"/>

<script>

function rc(){

   return parseInt(Math.random()*256);

}

$(function(){

   $("#rndc").click(function(){

      $("#box").css("background-color","rgb("+rc()+","+rc()+","+rc()+")");

   });

});

</script>


Correcting teacher:查无此人Correction time:2019-06-10 09:39:03
Teacher's summary:完成的还不错。作业要加上自己对功能的理解。继续加油。

Release Notes

Popular Entries