Testing to see if a text string is part of a variable
<p>I'm setting a variable to the contents of a h1 tag on my site. I want to write an if statement which tests to see if there is a specific word inside that h1 tag. I need to set a dropdown based on the title of the form.</p>

<p>So, I have this html.</p>

<pre><code>&lt;div id="booking-details"&gt;&lt;h1&gt;This is Los Angeles&lt;/h1&gt;&lt;/div&gt;
</code></pre>

<p>Here is the jquery:</p>

<pre><code>var city = $('#booking-details h1').text();
if (city.text().indexOf('Los Angeles') &gt;= 0)) {alert("This city is Los Angeles")};
</code></pre>

<p>I'm getting a syntax error and not quite sure how to pull the index of the text from the variable. </p>

<p>Thanks in advance for any help.</p>
