jq基础语法

Original 2019-04-02 10:18:01 180
abstract:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>jquery基础</title> <script src="https://code.jquery.com/jquery-3.3.1.m
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>jquery基础</title>
	<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body>
<button>body</button>
<script type="text/javascript">
	$(function(){
		$('body').css('background','pink');
		$color = '#';
		$color2 = Math.floor(Math.random()*10).toString()+Math.floor(Math.random()*10);
		$color3 = Math.floor(Math.random()*10).toString()+Math.floor(Math.random()*10);
		$color4 = Math.floor(Math.random()*10)+''+Math.floor(Math.random()*10);
		$color += $color2+$color3+$color4;
		console.log($color);
		$('button').click(function(){
			$('body').css('background',$color);
		})
	})
	
</script>
</body>
</html>


Correcting teacher:西门大官人Correction time:2019-04-02 11:26:10
Teacher's summary:代码的作用是什么,最好写一下注释,这样代码会更清晰一些。

Release Notes

Popular Entries