javascript get html or text from div

This is easy in jquery but how about plain javascript?

The code is for the Google image search API. I want to search images that match the html or preferably text inside a div.

var searchThis = document.getElementById('imgToFind'); //get HTML, or text from div

// Find images
imageSearch.execute(searchThis); //search image

The HTML

<div id="imgToFind">PlayStation</div>

The result should be images of playstation. Instead I get these

1 dosic ois - 123

alt text IE8 javascript returns [object HTMLDivElement] instead [

alt text Loving Hand

And other irrelevant images. I wonder what Google searches for.. think the second one is giving me a hint.

11
задан Cyber Junkie 5 December 2010 в 03:06
поделиться