smmsmm57
asked on
How to make an img tag item visible/invisible in display HTML
I am using an img tag in html that I want to not be visible when the page loads (that part works)
But I want to programatically make it show up and am apparently doing something wrong because the code
executes (I have an alert before and after) but the image does not show up...
Perhaps some kind of syntax error?
make invisible
<div style="position:absolute; left: 210px; top: 90px;" >
<img name="addtag" id="addtag" style="display:none"; src="jpg/AddTagGreenUp.jpg "
onclick="return ModalPopUp('AddTag.htm')">
</div>
make visible?
alert('b4');
document.getElementById('a ddtag').di splay = 'block';
alert('aft');
But I want to programatically make it show up and am apparently doing something wrong because the code
executes (I have an alert before and after) but the image does not show up...
Perhaps some kind of syntax error?
make invisible
<div style="position:absolute; left: 210px; top: 90px;" >
<img name="addtag" id="addtag" style="display:none"; src="jpg/AddTagGreenUp.jpg
onclick="return ModalPopUp('AddTag.htm')">
</div>
make visible?
alert('b4');
document.getElementById('a
alert('aft');
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
kbqwert:
Did you read any posts? That was my first suggestion.
Did you read any posts? That was my first suggestion.
Erm Bill: Your post was not obvious since I for one cannot think of a browser that uses
obj.display instead of obj.style.display
obj.display instead of obj.style.display
I don't remember. It was a long time ago. Probably one of the older browsers.
>>Semicolon is ok in a style attribute
i know that.. just wasn't sure if a semicolon outside the style attribute would mess it up. =P
i.e. "display:none";
i know that.. just wasn't sure if a semicolon outside the style attribute would mess it up. =P
i.e. "display:none";
Ahh, missed that. No it won't
ASKER