<script> function Go() { var n=(document.getElementById('typ').checked)? 500: 0 alert(n) } </script> <input type="checkbox" name="check" id="typ" onclick="Go()" />