<script type="text/javascript"> function set_select(value) { if (value == '3') alert(3); } set_select(<?php echo 3; ?>) </script>