js网页文字简体繁体转换
1、新建html文档。

2、书写hmtl代码。
<div class="container">
<div class="top"> <a href="#" class="zh_click" id="zh_click_s">简体</a> <a href="#" class="zh_click" id="zh_click_t">繁體</a> </div>
<div class="detail">
js网页文字简体繁体转换声!酋长:“烤好了。”</div>
</div>

3、书写css代码。
<style>
.container { max-width: 600px; height: auto; margin: auto; padding: 50px 0px; font-family: "microsoft yahei" }
.top { width: 100%; height: 50px; line-height: 50px; margin-bottom: 15px; }
.top a { width: 140px; height: 40px; display: block; float: left; margin-right: 10px; text-align: center; line-height: 40px; color: #00A1DF; text-decoration: none; }
.detail { width: 570px; padding: 10px; height: auto; line-height: 28px; text-indent: 28px; border: 5px solid #00A1DF; }
</style>

4、书写并添加js代码。
<script>
function setCookie(name, value){
var argv = setCookie.arguments;
var argc = setCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
if(expires != null){
var LargeExpDate = new Date ();
LargeExpDate.setTime(LargeExpDate.getTime() + (expires*1000*3600*24));
}
document.cookie = name + "=" + escape (value)+((expires == null) ? "" : ("; expires=" +LargeExpDate.toGMTString()));
}
function getCookie(Name){
var search = Name + "=";
if(document.cookie.length > 0){
offset = document.cookie.indexOf(search);
if(offset != -1){
offset += search.length;
end = document.cookie.indexOf(";", offset);
if(end == -1){
end = document.cookie.length;
}
return unescape(document.cookie.substring(offset, end));
}else{
return '';
}
}
}
</script>

5、代码整体结构。

6、查看效果。
