If in JavaScript

<script type="text/javascript">
var Salary = 10000;
var bonus = 0;
if (Salary >5000)
  {
  bonus=500;
  }
document.write("Your Bonus is "+bonus);
</script>