-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,530 additions
and
15 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<html lang="zh-CN"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>中英文切换按钮</title> | ||
</head> | ||
|
||
<body> | ||
|
||
<div id="content"> | ||
<h1 id="title">你好,世界!</h1> | ||
<p id="paragraph">这是一个简单的中英文切换按钮示例。</p> | ||
</div> | ||
|
||
<button onclick="toggleLanguage()">切换语言</button> | ||
|
||
<script> | ||
function toggleLanguage() { | ||
var titleElement = document.getElementById('title'); | ||
var paragraphElement = document.getElementById('paragraph'); | ||
|
||
if (document.documentElement.lang === 'zh-CN') { | ||
document.documentElement.lang = 'en'; | ||
titleElement.textContent = 'Hello, World!'; | ||
paragraphElement.textContent = 'This is a simple example of a language toggle button.'; | ||
} else { | ||
document.documentElement.lang = 'zh-CN'; | ||
titleElement.textContent = '你好,世界!'; | ||
paragraphElement.textContent = '这是一个简单的中英文切换按钮示例。'; | ||
} | ||
} | ||
</script> | ||
|
||
</body> | ||
|
||
</html> |