<script type="text/javascript">
function _set(){
// birth[0]→year, birth[1]→month, birth[2]→day
var _birth = parseInt("" + $('#year').val() + affixZero($('#month').val()) + affixZero($('#day').val()) );
var today = new Date();
var _today = parseInt("" + today.getFullYear() + affixZero(today.getMonth() + 1) + affixZero(today.getDate()));
$('#age').val(parseInt((_today - _birth) / 10000));
}
function affixZero(int) {
if (int < 10) int = "0" + int;
return "" + int;
}
</script>
[0回]
PR