Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
172
rated 0 times [  178] [ 6]  / answers: 1 / hits: 30158  / 13 Years ago, wed, july 20, 2011, 12:00:00

if $(this).val() have backslash remove backslash in it by jQuery. How is it?
1111/11/11 -> 1111/11/11


More From » jquery

 Answers
166
$(this).val().replace(/\/g, '');


You have to use two backslashes to get the character. A single backslash is used for control characters such as r n etc. Using the double backslash escapes this and gives you what you want.


[#91105] Monday, July 18, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
zariahdiamondz

Total Points: 649
Total Questions: 109
Total Answers: 88

Location: Tajikistan
Member since Thu, Apr 14, 2022
2 Years ago
;