Java & JavaScript Color Quiz Test Your Java & JavaScript Skills: Beginner’s Quiz 1 / 5 Which of the following is a valid way to set a color in JavaScript? element.color = “red” element.style.color = “red” element.style.textColor = “red” setColor(“red”) 2 / 5 Which Java method is used to set color in GUI applications (like Swing)? colorize() setTextColor() changeColor() setColor() 3 / 5 Which format can be used to define colors in JavaScript? Hex code (#FF0000) All of the above RGB (rgb(255,0,0)) Color names (“red”) 4 / 5 In Java, which class is commonly used to represent colors in GUI applications? java.util.Color java.lang.Color javax.swing.Color java.awt.Color 5 / 5 Which JavaScript property is used to change the text color of an element? fontColor textColor backgroundColor color Your score isThe average score is 0% 0% Restart quiz Send feedback