triggers - Could not find element inside Datalist by ID with JQuery -


below rendered datalist. seems $('#ctl00_contentplaceholder1_showlisting_datalist1$3$0$enquire').click(function() { ... } not work because when click on 1 of buttons (on datalist) meant trigger function, nothing happens.

how use jquery find buttons id? function should triggered if of buttons on datalist clicked.

thank you.

    <table id="ctl00_contentplaceholder1_showlisting_datalist1" class="datawebcontrolstyle"         style="visibility: visible;">         <tbody>             <tr>                 <td class="rowstyle">                     <div class="listitemcontainer">                         <div class="enquirebutton">                             <a class="activator" id="ctl00_contentplaceholder1_showlisting_datalist1$3$1$enquire">                             </a>                         </div>                     </div>                 </td>             </tr>             <tr>                 <td class="rowstyle">                     <div class="listitemcontainer">                         <div class="enquirebutton">                             <a class="activator" id="ctl00_contentplaceholder1_showlisting_datalist1$3$1$enquire">                             </a>                         </div>                     </div>                 </td>             </tr>         </tbody>     </table>      <script type="text/javascript">         $(function() {             $('#ctl00_contentplaceholder1_showlisting_datalist1$3$0$enquire').click(function() {                 $('#enquireoverlay').fadein('fast', function() {                     $('#box').animate({ 'top': '160px' }, 500);                 });             });             $('#boxclose').click(function() {                 $('#box').animate({ 'top': '-200px' }, 500, function() {                     $('#enquireoverlay').fadeout('fast');                 });             });         });     </script> 

you should use live.

  $("#boxclose").live("click", function() {                     $('#box').animate({ 'top': '-200px' }, 500, function() {                         $('#enquireoverlay').fadeout('fast');                     });                 }); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -