开发者

How do I escape this \ character in jQuery?

开发者 https://www.devze.com 2023-01-18 21:54 出处:网络
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:

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

精彩评论

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

关注公众号