javascript - Whether DOM property will work for Phone Gap android? -
i working on phonegap android project.
i know whether dom property work phone gap or not.because,i tried implementing condition such as
if(results.rows.item(val[1]).column_name==="") { document.getelementbyid("id").src="img/abc.png"; console.log("abc image changed"+val[1]); } else { document.getelementbyid("id").src="img/abc1.png"; console.log("no change "+val[1]); } html code:
i tried executing program in 2 of following cases in html
case 1:
<div id="id" > <img src="img/abc1.png" onclick="abc()" /></div> case 2:
<div id="id" > <img src="" onclick="abc()" /></div> when run program console statement being displayed,but there no change in image.
am right in way of implementation?
please guide.
div doesn't have attribute src. need give id img tag change src of image that:
<div> <img src="img/abc1.png" id="id" onclick="abc()" /></div> or can change image innerhtml property this:
document.getelementbyid("id").innerhtml = '<img src="img/abc.png" onclick="abc()" />'; use 1 want.
Comments
Post a Comment