For popover a division i'm using this code. I want to add multiple elements. When i add multiple elements with same id, the script doesn't work. How it solve? The script is.
<a href="#" id="button">Click me</a>
<div id="modal">
<div id="heading">
Are you sure you want to do that?
</div>
</div>
<!--jQuery-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="js/jquery.reveal.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#button').click(function(e) { // Button which will activate our modal
$('#modal').reveal({ // The item which will be opened with reveal
animation: 'fade', // fade, fadeAndPop, none
animationspeed: 600, // how fast animtions are
closeonbackgroundclick: true, // if you click background will modal close?
dismissmodalclass: 'close' // the class of a button or element that will close an open modal
});
return false;
});
});
</script>
I want to add like this.
<a href="#" id="button">Click me</a>
<div id="modal">
<div id="heading">
Are you sure you want to do that?
</div>
</div>
<a href="#" id="button">Click </a>
<div id="modal">
<div id="heading">
You want to do that?
</div>
</div>