Escape single quotes with \' instead of &#39; so it works inside attributes