Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

If i have code like this:

<select>
  <option value="path/to/image1.jpg">Image 1</option>
    <option value="path/to/image2.jpg">Image 2</option>
    <option value="path/to/image3.jpg">Image 3</option>
    <option value="path/to/image4.jpg">Image 4</option>
</select>

Will Google index images from the select tag?

share|improve this question
1  
I don't think so since an option is generally a value and not a path to a resource. So Google won't try to retrieve the image, but just read the value. –  j0k May 19 '13 at 14:14
    
Would it be good if i leave 'normal' links to images and then use JavaScript to generate SELECT option from that links? –  johnsmith May 19 '13 at 14:29
    
I think it will be better. –  j0k May 19 '13 at 14:49
add comment

1 Answer

Google scans your source code for items that look like URLs and will try to crawl them and index them, even if they are not in an <a href.

Based on the crawling that Googlebot has done on my site, Google seems to think that strings in the page source are URLs if:

  • They end in a common page extension such as "html", "htm", or "php".
  • They contain a slash such as "foo/bar"
  • They start with "http://" or "https://"

Both the first and second in that list apply to your situtation.

Googlebot seems to look in both javascript variables and option values for items that appear to be URLs. So Google will crawl mypage.html in both of the following senarios:

<option value="mypage.html">My Page</option>

<script>var s = "mypage.html";</script>

I haven't done any specific testing with images, but I would be suprised if Googlebot did not crawl your jpg images given the markup your provided.

You might also do better with SEO with an actual link to your images. Even if Google does crawl and index the images, it is not clear that links found not in <a href= pass pagerank the same way.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.