I want to use the same javascript function on more than 1 button , but it does not work. here is:
HTML
<a href="#" id="buton"><p> SOMETHING</p></a>
<a href="#" id="buton"><p> OTHERS</p></a>
<div id="link" style="display:none;">
<h1>SOMETHING</h1>
</div>
<div id="link" style="display:none;">
<h1>OTHERS</h1>
</div>
and JAVASCRIPT
<script>
$('#buton').click(function() {
$('#link').toggle('slow', function() {
// Animation complete.
});
});
</script>
so on the first buton it does work, but on the second one ( OTHERS ) it does not work. Why? and how can I fix that? ( I am about to use more than 10 buttons on my original page, so please give me the best idea )