Change button text to bold on click - Javascript jQuery

Javascript examples for jQuery:Form Button

Description

Change button text to bold on click

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-git.js"></script> 
  <script type="text/javascript">
function boldButton(num){//from   w  w  w . java2  s . co m
    $('#btn'+num).css( 'font-weight', '700' );
}

      </script> 
 </head> 
 <body> 
  <button class="btn" id="btn1" onclick="boldButton(1)">Test1</button> 
  <button class="btn" id="btn2" onclick="boldButton(2)">Test2</button>  
 </body>
</html>

Related Tutorials