I would like to change the text color by following javascript, but it not work, please suggest how to fix this problem, many thanks
function myFunction() {
var x = document.getElementsByClassName("eee").getElementsByClassName("abc")
x.style.color = "red";
}
<!DOCTYPE html>
<html>
<body>
<p id="demo" class="eee">
<p id="ccc" class="abc" style="color: green;">Click the button to change the color of this paragraph. </p>
</p>
<button onclick="myFunction()">Try it</button>
</body>
</html>