html - Cannot open the same Jquery UI dialog using another DIV tag -


i've been trying find solution allow me open same dialog box when user doesn't have access particular site. able open first div assigned id to.

you can view live example of working code here: http://jsfiddle.net/jtgcf/216/

only first "open" button works second 1 doesn't.

example of html:

<div id="content">     <a href="#open" id="open">open dialog</a> </div>  <div id="content">     <a href="#open" id="open">open dialog</a> </div>  <div id="ok-dialog">     <p>it's ok!</p> </div> 

the function:

$(function() {     $('#open').click (function() {         $('#ok-dialog').dialog ({             modal: true,             title: 'ok!'         });     }); }); 

id's supposed unique, used 1 element. jquery select first element given id. use class instead.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -