时间:2021-07-01 10:21:17 帮助过:14人阅读
本文实例讲述了jQuery实现QQ空间汉字转拼音功能。分享给大家供大家参考,具体如下:
html:
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>QQ空间的汉字转拼音代码</title>
<script id="jquery_183" type="text/javascript" class="library" src="/js/sandbox/jquery/jquery-1.8.3.min.js"></script>
</head>
<body>
<span id='pinyin'></span>
<script>
$(function() {
s = pinyin.convertPYs('净网2014');
$('#pinyin').html(s[0]+','+s[1]);
});
</script>
</body>
</html>css:
body {
color: #ff0;
}js: