1.完成某些事情后发出请求的原始方法
2.代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>元素选择器(标签选择器)</title>
<script src="../js/jquery-3.2.1.js"></script>
<script>
$(function(){
$("p").css("font-size","30px");
$("p").css("color","red");
$("p").css("text-align","center");
//拿到 p 标签对象中 id为 p2的对象内容
$("p#p2").css("color","greenyellow");//重新设置样式
window.location.href="https://www.baidu.com/"; //在原来的页面打开
window.open("http://www.w3school.com.cn")//在新的页面打开
window.location.back(-1);//表示返回到上一个页面
});
</script>
</head>
<body>
<p>因为有你</p>
<p id="p2">世界更精彩</p>
<p>明天会更好</p>
</body>
</html>