Yes! It's exactly what I needed. Thanks.
var a = document.getElementById("location").selectedIndex;
var markerTitle =
document.getElementById("location").options[a].text;
On Jul 12, 4:46 pm, Rossko <[email protected]> wrote:
> > I want to make title of the marker dynamic too. I'm not very good
> > in javascript... Any idea how to get 'Location 1' or 'Location 2' to
> > the javascript variable?
>
> It's a javascript question, not a Google Maps question. Nevertheless,
> Google provide a search engine to help
> http://www.google.com/search?q=javascript+get+option+text
> and this result from there looks relevant
> http://www.webdevelopersnotes.com/tips/html/getting_the_text_from_an_...
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.