I need help increasing the font size of a parent element without affecting the entire body's font size. How can I achieve this? For example, with the id="vs-1"
, I want to increase the font size of the grandparent li text here which is "1940".
$("li #vs-1").parents().css({
'color': '#ff3600',
'font-size': '35px'
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<ul>
<li>1940
<ul>
<li style="background-color: rgb(255, 54, 0);" id="vs-1"></li>
</ul>
</li>
<li>1970
<ul>
<li id="vs-2"></li>
</ul>
</li>
</ul>
However, when using this code, it affects the entire body ul li tag. Can someone provide me with a solution for this issue? Thank you.