ok i have this code:
<html>
<head>
<script src="js/jquery.js"></script>
<script type="text/javascript">
function ps()
{
$('#mm').slideDown("slow");
}
$(document).ready(function(){
$('#mm').hide();
document.onclick = $('#mm').hide(); //this is not working, this one should make the '#mm' hide.
});
</script>
<body>
<button onclick="ps()" id="title" class="bb">Page settings
<ul id="mm">
<li><a href="#">Title</a></li>
<li><a href="#">meta tags</a></li>
<li><a href="#">favicon</a></li>
<li><a href="#">header settings</a></li>
</ul>
</button>
</body>
</html>
now, all i want is whenever the user click on the button(‘#title’), this ul(‘#mm’) will show and of course if a user click a way or hover away on that ul, that ul will be hidden. hope someone could help, thanks in advance. im open on any suggestion. this is like a DROPDOWN MENU.
Start by closing your head section, and lots of other elements inside a button is probably not a good idea, and there’s no need for inline javascript handlers for this.
maybe somthing like this will work:
FIDDLE