From c9496addf08f71aab1c8fd90224217e8e9ce88c8 Mon Sep 17 00:00:00 2001 From: lmj01 Date: Thu, 21 Mar 2024 10:36:04 +0800 Subject: [PATCH] Update pinyin.html --- html/pinyin.html | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/html/pinyin.html b/html/pinyin.html index ee39d63..d8f1090 100644 --- a/html/pinyin.html +++ b/html/pinyin.html @@ -7,13 +7,14 @@ -
-

拼音翻译

-
-

生日

-
- - +
+

拼音

+
爱发音
+
+

汉字转换拼音

+
+ +
@@ -21,8 +22,8 @@

生日

const { pinyin } = pinyinPro; const elTextareaSrc = document.getElementById('idSrc'); const elTextareaDst = document.getElementById('idDst'); - elTextareaSrc.addEventListener('input', (event)=>{ - elTextareaDst.textContent = pinyin(elTextareaSrc.textContent); + elTextareaSrc.addEventListener('change', (event)=>{ + elTextareaDst.value = pinyin(elTextareaSrc.value); })