<html>

<head>

</head>

<script  language="javascript"  >

 

function exe(){

 

  var a1 = '10.02';

  console.log( ' value: '+ a1 );

  console.log( ' value: '+   typeof( a1 ) ); //string

    

  a1 = parseInt( a1 );

  console.log( ' value: '+   typeof( a1 ) );  //number

  console.log( ' value: '+ a1 );

    

  a1 += 3.2;  

  console.log( ' value: '+ a1 );  //13.2

  console.log( ' value: '+   typeof( a1 ) ); //number

}

 

 

 

</script>

    <body  >

        <div  style="  height:80px ; padding-top:200px ; padding-left:200px "  >

          <a href="javascript:exe();"  >  click  </a>        

        </div>

        

 

    </body>

</html>

'[.js] no category' 카테고리의 다른 글

base html 왁구  (0) 2019.08.03
include , 포함인지 여부  (0) 2017.09.13
1초에 한번 함수 실행  (0) 2017.09.06
Posted by 혜화초보
,



function exe(){

   var dt = new Date();

  

   var month = dt.getMonth()+1;

   var day = dt.getDate();

   var year = dt.getFullYear();

   var result  = month + '-' + day + '-' + year;

   

   console.log(  '' + result   );  

 }


'[.js] 날짜' 카테고리의 다른 글

날짜 빼기 , 11개월전 날짜 구하기  (0) 2018.11.21
현재날짜 YYYYMMDDHHMMSS  (0) 2018.10.05
날짜 초 분 더하기 빼기  (0) 2017.09.08
이달의 마지막날짜 구하기  (0) 2017.09.06
Posted by 혜화초보
,




 




<html>

<head>

</head>

<script  language="javascript"  >

 

// 2016 , 2  값을 변수 처리 하면 됩니다.

// 2016년 2월의 마지막 일자를 리턴.

 function exe(){

     var lastDay = new Date( 2016 , 2 , 0);

     console.log(' lastDay: '+ lastDay );

 }


</script>

    <body  >

        <div  style="  height:200px ; padding-top:200px ; padding-left:200px "  >

          <a href="javascript:exe();"  >  click  </a>        

        </div>

    </body>

</html>







'[.js] 날짜' 카테고리의 다른 글

날짜 빼기 , 11개월전 날짜 구하기  (0) 2018.11.21
현재날짜 YYYYMMDDHHMMSS  (0) 2018.10.05
날짜 초 분 더하기 빼기  (0) 2017.09.08
현재 날짜 구하기  (0) 2017.09.06
Posted by 혜화초보
,