Link to home
Start Free TrialLog in
Avatar of smmsmm57
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('addtag').display = 'block';
      alert('aft');
   
ASKER CERTIFIED SOLUTION
Avatar of Bill-Hanson
Bill-Hanson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of smmsmm57
smmsmm57

ASKER

This site is worth every penny of what I pay for it! Thanks MUch....
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
kbqwert:
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
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";
Ahh, missed that. No it won't