Jquery remove last child

by Chance Nursey-Bush

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("p:last-child").css("background-color", "yellow");
$(".innerDiv1 select:last-child").remove();
$("#secondDiv span:last-child").remove();
});

</script>
<body>

<p>The first paragraph in body.</p>

<div id="firstDiv" style="border:1px solid;">
<div class="innerDiv1">
  <select><option selected>Select 1 - Option 1</option></select>
  <select><option selected>Select 2 - Option 1</option></select>
</div>
</div><br>

<div id="secondDiv" style="border:1px solid;">
<div class="innerDiv2">
  <p>The first paragraph in another div.</p>
  <p>The last paragraph in another div.</p>
  <span>This is a span element.</span>
</div>
</div>

<p>The last paragraph in body.</p>

</body>