JavaScript获取汉字拼音

通过JavaScript获取输入汉字的简拼,全拼和混拼(非原创,作者不详).

<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="ChinesePY.js"></script>
</head>
<body style="font-size:12px">
<form>
输入内容: <input type="text" onkeyup="pym.innerHTML = Pinyin.GetJP(this.value);allpym.innerHTML=Pinyin.GetQP(this.value);
        staffpym.innerHTML=Pinyin.GetHP(this.value);"/> <br /><br />
拼 音 码: <span id="pym"></span><br /><br />
拼音全码: <span id="allpym"></span><br /><br />
混 拼 码: <span id="staffpym"></span>
</form>
</body>
</html>

JavaScript文件下载地址:https://files.cnblogs.com/cnscoo/ChinesePY.js

posted @ 2011-10-11 17:14  雨秋  阅读(2204)  评论(4编辑  收藏  举报