The code snippet below demonstrates a specific issue:
<span id="test1">some text</span>
<span id="test2">some text</span>
Upon loading the content, the following JavaScript is executed:
alert($('test1').text();
$('test2').text('different text');
Unexpectedly, the alert displays:
"http://fiddle.jshell.net"
and 'different text' isn't assigned to test2. Can anyone pinpoint the mistake in my implementation?