الفرق بين المراجعتين ل"jQuery/descendant selector"

من موسوعة حسوب
اذهب إلى التنقل اذهب إلى البحث
سطر 17: سطر 17:
  
 
=== أمثلة ===
 
=== أمثلة ===
وضع علامة على كافة المدخلات السليلة من نموذج له حدود زرقاء مُنقطة. وإعطاء خلفية صفراء لإدخالات الـعناصر السليلة الخاصة بمجموعة حقول سليلة من النموذج.<syntaxhighlight lang="html">
+
تنسيق كافة حقول الإدخال <code>[[HTML/input|<input>]]</code> السليلة من نموذج <code>[[HTML/form|<form>]]</code> بإضافة إطارٍ ذي لونٍ أزرق ونمط خطه منقط. وإعطاء خلفية صفراء لحقول الإدخال <code>[[HTML/input|<input>]]</code> السليلة من مجموعة حقول <code>[[HTML/fieldset|<fieldset>]]</code> سليلة من نموذج <code>[[HTML/form|<form>]]</code>:<syntaxhighlight lang="html">
 
<!doctype html>
 
<!doctype html>
 
<html lang="en">
 
<html lang="en">
سطر 65: سطر 65:
  
 
== مصادر ==
 
== مصادر ==
[http://api.jquery.com/descendant-selector/ صفحة التابع ‎Descendant Selector (“ancestor descendant”)‎‎ في توثيق jQuery الرسمي].
+
[http://api.jquery.com/descendant-selector/ صفحة ‎Descendant Selector في توثيق jQuery الرسمي].
 
[[تصنيف:jQuery]]
 
[[تصنيف:jQuery]]
 
[[تصنيف:jQuery Method]]
 
[[تصنيف:jQuery Method]]
[[
 
 
[[تصنيف:jQuery Selectors]]
 
[[تصنيف:jQuery Selectors]]
[[
 
 
[[تصنيف:jQuery Hierarchy]]
 
[[تصنيف:jQuery Hierarchy]]

مراجعة 09:00، 12 مايو 2018

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎محدد العناصر السليلة ‎“ancestor descendant”‎ 

الوصف

يُحدِد جميع العناصر التي تنتمي إلى سلف معين.

jQuery( "ancestor descendant" )‎

أُضيف مع الإصدار: 1.0.

ancestor

أي مُحدِد صالح.

Descendant

محدد لتصفية العناصر السليلة.

يمكن أن يكون سليل عنصرٍ ما هو إبن هذا العنصر، أو حفيده، أو ابن الحفيد، وهكذا.

أمثلة

تنسيق كافة حقول الإدخال <input> السليلة من نموذج <form> بإضافة إطارٍ ذي لونٍ أزرق ونمط خطه منقط. وإعطاء خلفية صفراء لحقول الإدخال <input> السليلة من مجموعة حقول <fieldset> سليلة من نموذج <form>:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>descendant demo</title>
  <style>
  form {
    border: 2px green solid;
    padding: 2px;
    margin: 0;
    background: #efe;
  }
  div {
    color: red;
  }
  fieldset {
    margin: 1px;
    padding: 3px;
  }
  </style>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
 
<form>
  <div>Form is surrounded by the green border.</div>
 
  <label for="name">Child of form:</label>
  <input name="name" id="name">
 
  <fieldset>
    <label for="newsletter">Grandchild of form, child of fieldset:</label>
    <input name="newsletter" id="newsletter">
  </fieldset>
</form>
Sibling to form: <input name="none">
 
<script>
$( "form input" ).css( "border", "2px dotted blue" );
$( "form fieldset input" ).css( "backgroundColor", "yellow" );
</script>
 
</body>
</html>

مصادر

صفحة ‎Descendant Selector في توثيق jQuery الرسمي.