you are not escaping the character like that, you have created a new string, which is part of a new attribute
to escape a duble quote you need to do \", note, I’m note sure it works in html attributes but it is a thing to try.
The other thing to try is to find different thing to write
I don’t think you need to escape the apostrophe in a string surrounded by double quotes