I have a simple code:
<div id="rss">
<div id="close">
<a href="#" ><img alt="close"src="images/close.png" width="16" height="12"/> </a>
</div>
<ul><a href="fill.php"><?php echo $rss['rss']; ?></a></ul>
</div>
I want when someone click image <a href="#" ><img alt="close"src="images/close.png" width="16" height="12"/> </a> entire <div id="rss"></div> would close. I’m looking at javascript function onclick="window.close(), but it looks is not what I need. Help, someone?
window.close will close an actual browser window. It sounds like you want the div
to hide instead.
As was pointed out in comments you can do this with the following javascript.
Note that we use single quotes in the javascript so that it doesn’t interfere with syntax of html. Also note that we return false which prevents the clicked link from navigating.