Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
161
rated 0 times [  167] [ 6]  / answers: 1 / hits: 34876  / 13 Years ago, fri, april 8, 2011, 12:00:00

This jsFiddle example works in Google Chrome, but in Internet Explorer then when the close icon is clicked the browser removes the pop-up element but results in the text 'none' being displayed in the browser window. Please explain how I can resolve this issue.



HTML:



<div id=popup>
<!-- Close popup link -->
<a href=javascript:document.getElementById('popup').style.display='none';>X</a>
</div>

More From » html

 Answers
2

Use onclick for the event handler instead of href http://jsfiddle.net/AE2X3/4/



<div id=popup>
<a href=# onclick=document.getElementById('popup').style.display='none';return false; id=close_popup></a>
<p>This is a pop-up.</p>
</div>

[#92846] Wednesday, April 6, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
makiyac

Total Points: 470
Total Questions: 100
Total Answers: 115

Location: Botswana
Member since Sat, Jan 7, 2023
1 Year ago
makiyac questions
Sun, Jan 16, 22, 00:00, 2 Years ago
Thu, Dec 17, 20, 00:00, 4 Years ago
Fri, Dec 4, 20, 00:00, 4 Years ago
;