regex - How do I target this character ’ and replace it using jQuery? -



regex - How do I target this character ’ and replace it using jQuery? -

i want replace singe (apostrophe) , double quotes nil using jquery. have form text area , characters not allowed. able replace these characters ' " not character ’ below code works first 2 characters not third:

function removequotes(str){ var str = $(str).val(); if(str != ''){ str = str.replace(/(['"’])/g, ''); homecoming str; } }; $('textarea').on('blur', function(){ $(this).val(removequotes($(this))); });

i input string

it's it"s it’s

and blur off text-area, output

its it’s

i have not been able rid of 3rd quote. noticed when copying line of text outlook (the 3rd it's).

str = str.replace(/([`'"’])/g, '');

jsfiddle http://jsfiddle.net/guest271314/xkes3/

jquery regex

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -