I have:
'<textarea data-ng-show="modal.showPreview == 'Source'" >'
How can I quote the word Source? I tried single quotes but that does not work.
I have:
'<textarea data-ng-show="modal.showPreview == 'Source'" >'
How can I quote the word Source? I tried single quotes but that does not work.
You can use escaped double quotes:
'<textarea data-ng-show="modal.showPreview == \"Source\"">'
You can escape the double quotes with Backslash (\)
Your code won't work as intended because, as soon as the browser encounters the first double quote, it will think that the string has finished.
You can refer to this: JavaScript Escape Characters
How about this:
'<textarea data-ng-show="modal.showPreview == \"Source\"" >'
You need to use backslash \
'<textarea data-ng-show="modal.showPreview == \"Source\"" >'