Find all h1 elements that are children of a div element and apply a background to them using jquery
- جي كويري
- 2021-09-18
- mhanasmh00489829403
الأجوبة
HTML Code :
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<title>Find all h1 elements that are children of a div element and apply a background to them</title>
</head>
<body>
<h1>abc</h1>
<div>
<h1>div-1</h1>
<h1>div-2</h1>
</div>
<h1>xyz</h1>
</body>
</html>
JavaScript Code :
$( "div > h1" ).css("background", "#0686c9");
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
معلومات ذات صلة