我想要达到的结果
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.btn{
width: 100px;
height: 30px;
}
</style>
</head>
<body>
<button class="btn"></button>
<script>
// location.assign = 'https://blog.csdn.net/'
// console.log(location);
// console.log(location.href);
// console.log(location.host);
// console.log(location.search);
// console.log(location.hash);
// console.log(location);
document.querySelector('.btn').onclick = () => {
location.href = 'https://blog.csdn.net/'
console.log(location.href);
}
</script>
</body>
</html>
```