On the last page you found the start and end of a piece of text and now you will extract it.  Add this code under the last block:

var lengthOfString=indexEndResult-searchStart;
var pieceOfString=longerString.substr(searchStart, lengthOfString);
alert(pieceOfString);

These lines:

  1. work out how long the string (the name) is by subtracting the start position from the beginning of the </span> tag
  2. extract the substring using the known start and the length
  3. alert the substring (the name only)

You may not use this in JavaScript but some people will.  A large amount of programming is about manipulating text.  If you are doing all of these tutorials and then will be developing sites with databases behind them you will probably use PHP and SQL to manipulate the text but you never know.