ใใๆนโ ๏ผใใฟใณๆผไธใงๅคๆ
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>ใใฉใผใซในใขใฆใใจใใฟใณๆผไธๆใฎๅ
จ่งใซใฟใซใๅคๆ</title>
</head>
<body>
<input type="text" id="inputField" placeholder="ๅ
ฅๅใใฆใใ ใใ">
<button onclick="convertToKatakana()">ๅคๆ</button>
<script>
function toFullWidthKatakana(str) {
return str.replace(/[\u3041-\u3096]/g, function(match) {
// ใฒใใใชใๅ
จ่งใซใฟใซใใซๅคๆ
return String.fromCharCode(match.charCodeAt(0) + 0x60);
}).replace(/[\uFF61-\uFF9F]/g, function(match) {
// ๅ่งใซใฟใซใใๅ
จ่งใซใฟใซใใซๅคๆ
return String.fromCharCode(match.charCodeAt(0) - 0xCF25);
});
}
function convertToKatakana() {
const inputField = document.getElementById('inputField');
const inputValue = inputField.value;
const convertedValue = toFullWidthKatakana(inputValue);
inputField.value = convertedValue;
}
</script>
</body>
</html>
ใใๆนโก๏ผใใฉใผใซในใขใฆใๆใซๅคๆ
่ฃ่ถณ๏ผๅฎใฏใใใฟใณๆผไธใใจใใๅไฝใใใใจใใซใใใฉใผใซในใขใฆใใใ็บ็ซใใใฎใงใใใใซใใonclick่จญๅฎใชใใฎใใฟใณใ้ ็ฝฎใใใใๆผไธๆใซonBlur็บ็ซใงๅคๆใงใใ
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>ใใฉใผใซในใขใฆใๆใฎๅ
จ่งใซใฟใซใๅคๆ</title>
</head>
<body>
<input type="text" id="inputField" placeholder="ๅ
ฅๅใใฆใใ ใใ">
<script>
function toFullWidthKatakana(str) {
return str.replace(/[\u3041-\u3096]/g, function(match) {
// ใฒใใใชใๅ
จ่งใซใฟใซใใซๅคๆ
return String.fromCharCode(match.charCodeAt(0) + 0x60);
}).replace(/[\uFF61-\uFF9F]/g, function(match) {
// ๅ่งใซใฟใซใใๅ
จ่งใซใฟใซใใซๅคๆ
return String.fromCharCode(match.charCodeAt(0) - 0xCF25);
});
}
function convertToKatakana() {
const inputField = document.getElementById('inputField');
const inputValue = inputField.value;
const convertedValue = toFullWidthKatakana(inputValue);
inputField.value = convertedValue;
}
document.getElementById('inputField').addEventListener('blur', convertToKatakana);
</script>
</body>
</html>
ใใๆนโข๏ผๅ ฅๅใใชใใๅคๆ
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>ใชใขใซใฟใคใ ๅ
จ่งใซใฟใซใๅคๆ</title>
</head>
<body>
<input type="text" id="inputField" placeholder="ๅ
ฅๅใใฆใใ ใใ">
<script>
function toFullWidthKatakana(str) {
return str.replace(/[\u3041-\u3096]/g, function(match) {
// ใฒใใใชใๅ
จ่งใซใฟใซใใซๅคๆ
return String.fromCharCode(match.charCodeAt(0) + 0x60);
}).replace(/[\uFF61-\uFF9F]/g, function(match) {
// ๅ่งใซใฟใซใใๅ
จ่งใซใฟใซใใซๅคๆ
return String.fromCharCode(match.charCodeAt(0) - 0xCF25);
});
}
function convertInputToKatakana() {
const inputField = document.getElementById('inputField');
const inputValue = inputField.value;
const convertedValue = toFullWidthKatakana(inputValue);
inputField.value = convertedValue;
}
document.getElementById('inputField').addEventListener('input', convertInputToKatakana);
</script>
</body>
</html>
Comments
ๅ่งใซใฟใซใใใใใใชๅคๆใใใใใใใงใใ
๏พ๏พ๏ฝฐ๏พ๏พ๏พ๏ฝฐ๏ฝฝ
โใในใใใจในใใ
Let's comment your feelings that are more than good