---
title: "How to replace character in jquery?"  
description: "How to replace character in jquery?"  
author: "Anonymous User"  
published: 2014-10-06  
updated: 2014-10-06  
canonical: https://www.mindstick.com/forum/2310/how-to-replace-character-in-jquery  
category: "jquery"  
tags: ["jquery", "javascript"]  
reading_time: 1 minute  

---

# How to replace character in jquery?

My [Google](https://www.mindstick.com/articles/43833/google-lighthouse-and-how-is-it-changing-the-way-we-development-and-design-websites) [Map](https://yourviews.mindstick.com/view/81351/nepal-parliament-s-approves-new-controversial-map-india-rejects-it-but) is not [reading](https://www.mindstick.com/articles/126273/books-commonly-found-on-college-reading-lists) the [values](https://www.mindstick.com/forum/327/sum-textbox-values) from jquery thus displaying an empty div of where the markers/places should show. But when I add the values in manually from how it is read from the [textbox](https://www.mindstick.com/forum/12714/dynamic-textbox-in-gridview) it does display the map with all the markers. So I guessed that the "\" [character](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character) is the problem. I have tried replacing it with a blank [space](https://www.mindstick.com/articles/12954/do-your-electrical-repair-in-your-own-space), but it's not working.this is [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii):

```
var marker = $('#txtMarkers').val();var markers = marker.replace(/\\/gi, " ");
```

but it is not removing the "\" character. What can I do to get this [right](https://www.mindstick.com/articles/12766/check-whether-you-are-doing-digital-transformation-right-or-not)? ...I'm not used to working in [javascript](https://www.mindstick.com/articles/874/how-to-create-watermark-text-for-textbox-by-using-javascript)/jqeury and is fairly new to this, any help or suggestions will be appreciated.\

## Replies

### Reply by Anonymous User

try this code:

```
var marker = $('#txtMarkers').val();var markersObj = JSON.parse(marker);console.log(markersObj)
```


---

Original Source: https://www.mindstick.com/forum/2310/how-to-replace-character-in-jquery

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
