jquery - button inside table calling javascript? -


<html> <apex:includescript value="//cdn.jsdelivr.net/jquery/1.7/jquery.min.js"/>           <table width="100%">              <tr>              <td width="84%">                    <apex:form id="form1" >             <table bgcolor="#00c4ff" style="position:fixed;" width="100%" height="80">              <tr>              <td >                    <b style="color:white;"> :</b>                     </td>             <td>                       <apex:selectlist value="{!operator}" size="1" id="operator"  styleclass="input">                         <apex:selectoption itemvalue="=" itemlabel="equal" />                         <apex:selectoption itemvalue="!=" itemlabel="not equal to"/>                         <apex:selectoption itemvalue="<=" itemlabel="less or equal"/>                         <apex:selectoption itemvalue=">=" itemlabel="greater or equal"/>                         <apex:selectoption itemvalue=">" itemlabel="greater than"/>                         <apex:selectoption itemvalue="<" itemlabel="less than"/>                         <apex:selectoption itemvalue="like" itemlabel="like"/>                     </apex:selectlist>                     </td>                     <td>              <apex:inputtext value="{!inputtext1}" id="autocomplete1"  styleclass="input"/>             </td>             <td>                     <apex:commandbutton value="default view" action="{!showlist}" styleclass="input"/>                     </td><td></td></tr></table><br/><br/><br/>                      </apex:form></td><td style="padding-top:173px;">                     <button id="plusbtn" width="20px">+</button>                     <button id="minusbtn" width="20px">-</button></td></tr></table>     </html> 

// when button inside table not working.it not calling javascript when button outside table calling javascript. working fine

     <button id="plusbtn" width="20px">+</button>                 <button id="minusbtn" width="20px">-</button>  java script:      <script type="text/javascript">             $(document).ready(function(){             var currffzoom = 1;             var curriezoom = 100;             var  button1 = document.getelementbyid("plusbtn");     $(button1).on('click',function(){         if ($.browser.mozilla){             var step = 0.02;             currffzoom += step;              $("[id$=tblquotes]").css('-moz-transform', 'scale(' + currffzoom + ')');         } else {             var step = 2;             curriezoom += step;             $("[id$=tblquotes]").css('zoom', curriezoom + '%');         }     });      $('#minusbtn').on('click',function(){         if ($.browser.mozilla){             var step = 0.02;             currffzoom -= step;                              $("[id$=tblquotes]").css('-moz-transform', 'scale(' + currffzoom + ')');          } else {             var step = 2;             curriezoom -= step;             $("[id$=tblquotes]").css('zoom', curriezoom + '%');         }     });             });     </script> 

when button inside table not working.it not calling javascript when button outside table calling javascript. working fine

best can without seeing html:

change

    var  button1 = document.getelementbyid("plusbtn"); $(button1).on('click',function(){ 

to

    var  button1 = $("#plusbtn"); button1.click(function(){ 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -