开发者

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")

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜