Doing a find and replace of a span in jquery
<p>Ok i have the following code in jquery. I want to do a find and replace in jquery, I want to find the first span and replace it with a  variable. So my question is how would i go about finding the first span, and then find the second?</p>

<pre><code>&lt;html&gt; 
      &lt;head&gt; 
        &lt;title&gt;JQuery Problem 2&lt;/title&gt; 
        &lt;script type="text/javascript" src="jquery-1.4.min.js"&gt;&lt;/script&gt; 
        &lt;script type="text/javascript" src="problem2.js"&gt;&lt;/script&gt; 
      &lt;/head&gt; 
      &lt;body&gt; 
        &lt;div id="game"&gt; 
          &lt;form onsubmit="return false"&gt; 
            &lt;p&gt; 
              Guess:
              &lt;input type="text"/&gt; 
              &lt;input type="submit" value="Go"/&gt; 
            &lt;/p&gt; 
            &lt;p&gt; 
              &lt;strong&gt;Number of guesses:&lt;/strong&gt; 
              &lt;span&gt;0&lt;/span&gt; 
            &lt;/p&gt; 
            &lt;p&gt; 
              &lt;strong&gt;Last guess:&lt;/strong&gt; 
              &lt;span&gt;None&lt;/span&gt; 
            &lt;/p&gt; 
            &lt;table border="1" cellpadding="4" cellspacing="1" style="width: 400px"&gt; 
              &lt;tr&gt; 
                &lt;th&gt;Guess&lt;/th&gt; 
                &lt;th&gt;Result&lt;/th&gt; 
              &lt;/tr&gt; 
            &lt;/table&gt; 
          &lt;/form&gt; 
        &lt;/div&gt; 
      &lt;/body&gt; 
    &lt;/html&gt; 
</code></pre>

<p>Here is my jquery</p>

<pre><code>$(document).ready(function()
{

    var randomNum = Math.floor(Math.random()*101)
     var $guess
     var $count = $("#game span")
     var guessCount = 0;
     var lastGuess;


     $(":text").change(function() 
     {
        $guess = $(this).val()
        guessCount++;


        if (isNaN( parseInt($guess) ))
        {
            //alert("not a number")
            alert($count.html())

        }

        else if( $guess != randomNum )
        {
            //alert(randomNum)
        }

        else
        {
            //alert("You Win")
        }


    });





});
</code></pre>
