Compare equals '=' character in javascript - Javascript String Operation

Javascript examples for String Operation:String Character

Description

Compare equals '=' character in javascript

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> 
 </head> //w w  w .j  av  a2 s  .  c  o  m
 <body> 
  <button class="calcinput" type="button">1</button> 
  <button class="calcinput" type="button">2</button> 
  <button class="calcinput" type="button" value="=">=</button> 
  <script type="text/javascript">
$(".calcinput").on('click',function(){
  if($(this).val() === "="){
    console.log("equal");
  }
})

      </script>  
 </body>
</html>

Related Tutorials