JavaScript equality comparison is a crazy thing, sometimes. When in doubt, use three equals signs. You can view the demo here.