I'm using jQuery to find out if there is an li with the attribute of data-val="-1" inside the #mainNavigation div. In jQuery this works fine, but I need to do the same thing in JavaScript. What I can't figure out is how to drill down the way it's done using selectors in jQuery.
if($('#mainNavigation ul li ul li[data-val="-1"]')){
$("#mainNavigation").css("padding-left" , "10px");
};
<div id="mainNavigation">
<ul>
<li>
<ul>
<li data-val="-1">Title</li>
</ul>
</li>
</ul>
</div>