How do I escape this \ character in jQuery?
I want to use this following in jQ开发者_JAVA技巧uery
:contains("C:\ My Name")
How do I escape the escape character?
Use a double \\
to get a single, like this:
:contains("C:\\ My Name")
You can test it here. You can find other tips like this at the top of the selectors portion of the API.
Use a double backslash. Also, you probably want to remove the leading space from " My Name" as that is not a valid path.
:contains("C:\\My Name")
Use a back-slash to escape itself. \\
:contains("C:\\My Name")
精彩评论