Html image link, not working
- by Anders Metnik
Hey I'm doing some testing while learning js + html5 and other web/mobile frameworks.
I have a problem with one of my picture links, which I also need to change the picture dynamically and the target(hopefully).
But it won't work.
HTML:
<div data-role="content" id="firstPageContent">
<p>I'm first in the source order so I'm shown as the page.</p>
<p>View internal page called <a href="#second">second</a></p>
<a href = "#second" id="mapLink" name="mapLink"><img id="mapLinkImage" alt="a map which links to the mapPage" src="images/main_header.png"/></a>
<Button id="loadButton" onClick="load()"/>
</div><!-- /content -->
js:
importScripts(dataManager.js);
var mapLink=second;
function load(){
alert('called');
document.getElementById('mapLinkImage').src="images/store.map.png";
document.getElementById('mapLink').href = "http://google.com";
}
problem:
It ain't showing the image as a link, just as a plain image.
i think this will work now.