var text = "\"http://example.com\"";
Whatever your text, to wrap it with "
, you need to put them and escape inner ones with \
. Above will result in:
"http://example.com"
More Related Contents:
- Escaping HTML strings with jQuery
- How to find if an array contains a specific string in JavaScript/jQuery?
- How do I check if string contains substring? [duplicate]
- Remove whitespace and line breaks between HTML elements using jQuery
- How can I use jQuery to style /parts/ of all instances of a specific word?
- How can val() return Number?
- Wrap tags around http text
- Convert javascript array to string
- Split a string based on multiple delimiters
- How to trim() white spaces from a string?
- Insert space before capital letters
- Format a JavaScript string using placeholders and an object of substitutions?
- jQuery call function from a string [duplicate]
- How Can I Truncate A String In jQuery?
- Remove occurrences of duplicate words in a string
- Javascript / Jquery – Get number from string
- How to test if a URL string is absolute or relative?
- How to check if a string is a legal “dd/mm/yyyy” date?
- JQuery string contains check [duplicate]
- How to get text between two characters?
- Find and replace nth occurrence of [bracketed] expression in string
- Does jQuery strip some html elements from a string when using .html()?
- How to count string occurrence in string?
- Convert array to JSON
- JavaScript eyedropper (tell color of pixel under mouse cursor)
- Export HTML table to CSV using vanilla javascript
- Inserting arbitrary HTML into a DocumentFragment
- AJAX: Submitting a form without refreshing the page
- Remove/ truncate leading zeros by javascript/jquery
- How can I stop jQuery.ajax() from logging failures to the console?