JavaScript基礎 プロパティ
document.getElementById('target');
addEventListener.('click',function(){
// document.getElementById('target').style.background = 'pink';
// document.getElementById('target').style.borderRadius = '50%';
target.classList.toggle('circle');
)};
・document.getElementById('target'); //' '内のデータを取得してねという意味
・addEventListener(' ',) さらに機能を追加する際に使用。''内にはどのような場合かを記入されてている。
・function(){} 複数の処理を記入時に使用。関数といわれるもの。
※{}内のものはインデントを下げるルールがある。
・コメント削除の仕方
→//・・・・・;
//以降の記述はコメント機能で実行されない
.box{
width:100px;
height:100px;
background:skyblue;
cursor:pointer;
transition:0.8s;
}
.circle{
background:pink;
border-radius: 50%;
transform: rotate(360deg);
}
アニメーションの知識
ransition プロパティ→ アニメーションを行う時間
transform: rotate();→アニメーションの書類:回転される
※()内は何度回転させるか!