Javascript Data Type How to - Compare unicode code tick mark values








Question

We would like to know how to compare unicode code tick mark values.

Answer


<!DOCTYPE html>
<html>
<body>
  <textarea id="location">&#10004;</textarea>
<script type='text/javascript'>
<!--from  ww w  . j a  va2 s  .  c  om-->
if(document.getElementById('location').value.charAt(0) == '\u2714')
    document.writeln("symbol");
else
    document.writeln("not there");

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

The code above is rendered as follows: