I am currently working on an angular project where I need a button to add a blockquote within a div, but only if the blockquote is not already present in the HTML structure.
My initial approach was to search for the specific string
<blockquote id='myBlockquote'>
within the HTML content using the code snippet below, however, it does not seem to be functioning as expected:
if ((myHTML.indexOf('<blockquote id="myBlockquote">') = -1)) {
myHTML.append('some HTML');
}
I'm clearly missing something here. Can someone point me in the right direction?
Thanks!