Change button text according to value of same tag in Jquery - Javascript jQuery

Javascript examples for jQuery:Form Button

Description

Change button text according to value of same tag in Jquery

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//w  ww . ja  va 2s  . c  o m
if ($('i').text() == '000') {
    $('button').text('Text2');
}
    });

      </script> 
   </head> 
   <body> 
      <i>0</i> 
      <i>0</i> 
      <i>4</i> 
      <button>Test</button>  
   </body>
</html>

Related Tutorials