I need to remove japanese from text input box using jQuery, but somehow this is not working
My code:
$('#email').keyup(function () {
this.value = $(this).val().replace(/[^a-zA-Z0-9!.@#$%^&*()_-]/g,'');
});
// try my-email@yopmail.com確認用
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="email" id="email" size="50" />
If I type japanese after original email: (my-email@yopmail.com確認用) or after @ symbol:(my-email@確認用) then code isn't working. It doesn't replace japanese. I don't know the reason.