通过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