Programming

[CS50, Javascript] Day 15

그렉그의 2023. 2. 22. 09:55
const title = document.querySelector("div.hello:first-child h1");

function animation(){
title.style.color= "blue";
}

function animation2(){
title.innerText="whoala";
}

function handleWindowResize(){
document.body.style.backgroundColor="black";
}

title.addEventListener("click", animation);
title.addEventListener("mouseenter", animation2);
window.addEventListener("resize", handleWindowResize);




C

 
#include <stdio.h>
#include <cs50.h>

int main(void)
{
int numbers[6] = {4, 8, 15, 16, 23, 42};

for (int=0; i<6; i++)
if{
number[i]==50
{
printf("found");
}
printf("not found");
}
}