How do I escape a single quote in jQuery?

Use backslash

"Workers\'_Compensation";

Inside a selector you would require 2 of them "Workers\\'_Compensation";

Check Fiddle

Leave a Comment

error code: 523