Files
2018-10-16 21:32:40 +05:30

360 B

title, localeTitle
title localeTitle
Target the Parent of an Element Using jQuery 使用jQuery定位元素的父级

使用jQuery定位元素的父级

<script> 
  $(document).ready(function() { 
    $("#target1").parent().css("background-color", "red"); // Selects the parent of #target1 and changes its background-color to red 
  }); 
 </script>