The next step is to display some information about photos when they are selected. To do this, we'll need to listen for an event on the select interaction's collection of selected features and retrieve the features that were selected. Our plan is to have some photo information display when we select features:
<div> tag that will appear below the map. In your HTML code, add the following line after the map's <div> tag:<div id='photo_info ></div>
var selectedFeatures = select.getFeatures();
add event. For now, let's put the URL of the selected photo into our photo_info <div> tag:selectedFeatures.on('add', function(event) {
var feature = event.target.item(0);
var url = feature.get('url');
$('#photo-info').html(url);
});photo_info <div> tag:selectedFeatures.on('remove', function(event) {
$('#photo-info').empty();
});We used the select interaction to respond to the user selecting photos. While there is no direct way to do this, we can use the add and remove events of the collection returned by getFeatures to update our photo_info div with some information about the selected photo.
Earlier, we revealed what information is available for each feature by running the following code in the JavaScript console:
var feature = flickrSource.getFeatures()[0]; feature.getProperties();
And, we saw the following in the console:

We can see that each feature has some interesting information we might want to display:
author and author_id: These are useful for identifying the Flickr user that took the photo.date_taken and published: These contain the date that the photo was taken and the date it was published to Flickr.description: This is a pregenerated HTML string that contains useful information about the photo including the user's description, if available.link: This takes you to the actual Flickr page for the photo.tags: This is a space-separated list of tags associated with the photo.title: This was provided by the user that uploaded the photo.The description property seems like a great thing to display. It's nicely formatted and includes some interesting information for some photos. Unfortunately, all that nice formatting only shows up if we insert the description as HTML into our page. Injecting untrusted HTML into a page, without first sanitizing it, makes your application prone to XSS (Cross-site scripting) attacks, a technique for injecting and executing unauthorized JavaScript into web pages. You should never inject HTML from an untrusted source into a web page. Even though it might seem safe to trust Flickr, we'll be prudent and avoid the description property by creating our own description from other information available.