상세 컨텐츠

본문 제목

how to style property change in js ?

개발생활/JavaScript

by 한국인맛집 2019. 1. 3. 14:06

본문

반응형

Java Script style property change 



  • HTML CODE

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
       <div id="target"> hello ! koboso </div>
</body>
</html>



  • div#target change this! in JavaScript


$(document).ready(function(){

   
   document.getElementById('target').style.display = "none";
document.getElementById('target').style.width= "300px";
document.getElementById('target').style.border = "1px solid black";
});

반응형

관련글 더보기