jQuery if condition text contains
<p>I wrote a simple if condition, but not quite working.
if text is 123 change to hi, if text is 456 change it to hi2
Could someone please give me a hand.</p>

<pre><code>    &lt;h1&gt;123&lt;/h1&gt;
    &lt;h1&gt;456&lt;/h1&gt;
    &lt;h1&gt;789&lt;/h1&gt;​


$(document).ready(function() {

    var changeText1 = '123';
    var changeText2 = '456';
    var text = $(h1).text();

    if (text == changeText) {
        $(this).text('hi');
    } else if (text == changeText2 ) {
        $(this).text('hi2');
    }

});
</code></pre>

<p>​</p>

<p><a href="http://jsfiddle.net/8P2ma/" rel="nofollow">http://jsfiddle.net/8P2ma/</a></p>
