@ahmedmelfay
Posted
document.getElementById("d2").getElementsByTagName("p")[0].style.color = "black"; document.getElementById("d2").getElementsByTagName("p")[0].style.fontWeight = "700";
javascript applies the styling inside of your html therefore overwriting your css and giving your p[0] color of black and font weight of 700