Grab the ID of a SPAN tag and add some value to a Text Box Field according to which tag has been clicked
<p>I was trying to grab the ID of the SPAN tag when a user clicked it.<br/>
Since the ID of each tag contains two digits, they would be used for referring<br/>
to the value of their corresponding hidden text box field,<br/>
but I am stuck over this question.<br/></p>

<p>Here is part of the code that I have written.<br/>
I need your help to finish it because I don't know how to move on.<br/></p>

<pre><code>&lt;script type="text/javascript"&gt;
    $(document).ready(function(){ 
           $("#^=content").click(function(event){
        // var digit = extract the last two digit of the id
           var id_of_the_hidden_field = "hidden"+digit;
           $("#show").val()=$("#hidden").val();
            });
        });
&lt;/script&gt;
&lt;div id="test22"&gt;
&lt;span id="content22"&gt;Click to add the value&lt;/span&gt;
&lt;input type="hidden" id="hidden22" value="hello"&gt;
&lt;/div&gt;

&lt;div id="test33"&gt;
&lt;span id="content33"&gt;Click to add the value&lt;/span&gt;
&lt;input type="hidden" id="hidden33" value="world"&gt;
&lt;/div&gt;

&lt;input type="text" id="show"&gt;
</code></pre>
