Reputation: 13206
Running
javascript: alert(document.getElementById('srchssubTitle').value)
at
http://www.bing.com/maps/#Y3A9NTIuMDYzNjAyfi0wLjc3Nzg5NCZsdmw9MTUmc3R5PXImZW89MCZxPU1LMyUyMDVKRQ==
returns me an unidentified value
message, even though I've checked the page source code and found that I referring to the correct id
<span class="ssubLatLon" id="srchssubTitle">51.990376,-0.761363</span>
.
How do I get JavaScript to properly echo this value?
Upvotes: 0
Views: 21
Reputation: 10140
You have to use innerHTML
property:
javascript: alert(document.getElementById('srchssubTitle').innerHTML);
Upvotes: 1