###前提・実現したいこと
jQueryで全角から半角へ変換する機能を実装したいと思いサイトを参考にしながらやりました。
参考サイト:http://www.koikikukan.com/archives/2013/08/28-015555.php
これをcakePHPに入れて行いました。
それで質問なんですがこれをreadyやonloadを外して実行したいのですがうまくいきません。
どこを変更させたらreadyやonloadなしでも動きますか?
よろしくお願いします。
$(".test").change(function(){
var str = $(this).val();
str = str.replace( /[A-Za-z0-9-!”#$%&’()=<>,.?_[]{ }@^~¥]/g, function(s) {
return String.fromCharCode(s.charCodeAt(0) - 65248);
});
$(this).val(str);
}).change();
あなたの回答
tips
プレビュー