主要用于模糊查詢(xún),或者快速查找
代碼如下
<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame Remove this if you use the .htaccess --> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>漢字簡(jiǎn)拼</title> <meta name="description" content=""> <meta name="author" content="Administrator"> <meta name="viewport" content="width=device-width; initial-scale=1.0"> <!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references --> <link rel="shortcut icon" href="/favicon.ico"> <link rel="apple-touch-icon" href="/apple-touch-icon.png"> </head> <body> <center> <input type="text" id="wordC" /> <input type="button" id="btn" value="獲取簡(jiǎn)拼" /> <h1 id="wordE"> </h1> </center> </body> <script type="text/javascript"> window.onload = function() { document.getElementById("btn").onclick = function() { var wordC = document.getElementById("wordC").value; var wordE = letterArr(wordC); document.getElementById("wordE").innerHTML = wordE.toUpperCase(); }; //獲取字符串首字母 /** * arrInitialChart數(shù)組將unicode 19968-40869 編碼分為26個(gè)元素,每個(gè)元素的首字母都相同,按英文字符排序 * arrNumLetter數(shù)組為每個(gè)arrInitialChart數(shù)組的元素id所對(duì)應(yīng)的英文字母 * arrPolyphone數(shù)組為377個(gè)聲母不同的多音字的首字母字符串 */ var arrInitialChart = new Array(); arrInitialChart[0]="
主站蜘蛛池模板:
米泉市|
红原县|
清新县|
武穴市|
屏东市|
成安县|
平顺县|
龙山县|
黑河市|
成安县|
平原县|
岚皋县|
德安县|
绥德县|
行唐县|
信丰县|
新丰县|
贵港市|
安顺市|
宾川县|
永宁县|
玛沁县|
酒泉市|
五指山市|
东安县|
南澳县|
收藏|
湄潭县|
呼伦贝尔市|
河北区|
高碑店市|
天津市|
垫江县|
通河县|
犍为县|
贡山|
乌鲁木齐县|
封丘县|
紫阳县|
孝感市|
新田县|