I'm encountering an issue where I can't target the second child of an li element and use it in a conditional statement. Are jQuery conditionals not compatible with li:nth-child(2)?
if($(".steps ul li:first-child").attr('aria-selected') == "true") {
$( ".steps ul li:first-child" ).append( "<div class='step-img'><img src='../images/step1.png' alt='Step 1'></div>" );
}
if(".steps ul li:nth-child(2)").hasClass(".current")) {
$( ".steps ul li:nth-child(2)" ).append( "<div class='step-img'><img src='../images/step2.png' alt='Step 2'></div>" );
}