Dear lovely fellows,
please help me with this code, I want to learn how to merge multiple functions and I tried a lot but with dead end. I’m a self learning person and online community are my teachers.
CODE ATTACHED BELOW HTML FIRST THEN JS
<section id="ingredients" onmouseover="ingredientsHover()" onmousedown="ingredientsNormal()">
<h2>ingredients <i class="fa fa-coffee" aria-hidden="true"></i>
-----
<script>
function ingredientsHover() {
document.getElementById('ingredients').firstElementChild.firstElementChild.style.fontSize = '300%';
}
function ingredientsNormal() {
document.getElementById('ingredients').firstElementChild.firstElementChild.style.fontSize = '100%';
}
function preparationHover() {
document.getElementById('preparation').firstElementChild.firstElementChild.style.fontSize = '300%';
}
function preparationNormal() {
document.getElementById('preparation').firstElementChild.firstElementChild.style.fontSize = '100%';
}
</script>