File tree Expand file tree Collapse file tree 4 files changed +102
-100
lines changed
2-ui/1-document/06-dom-attributes-and-properties Expand file tree Collapse file tree 4 files changed +102
-100
lines changed Original file line number Diff line number Diff line change 1- importance : 5
1+ درجة الأهمية : 5
22
33---
44
5- # Get the attribute
5+ # الخصول على الخاصية
66
7- Write the code to select the element with ` data-widget-name ` attribute from the document and to read its value .
7+ اكتب الرمز لتحديد العنصر الذي يحتوي على السمة ` data-widget-name ` من المستند وقراءة قيمته .
88
99``` html run
1010<!DOCTYPE html>
@@ -19,3 +19,4 @@ Write the code to select the element with `data-widget-name` attribute from the
1919</body >
2020</html >
2121```
22+
Original file line number Diff line number Diff line change 1+ أولاً ، نحن بحاجة إلى العثور على جميع المراجع الخارجية.
12
2- First, we need to find all external references .
3+ هناك طريقتان .
34
4- There are two ways.
5-
6- The first is to find all links using ` document.querySelectorAll('a') ` and then filter out what we need:
5+ الأول هو العثور على جميع الروابط باستخدام ` document.querySelectorAll ('a') ` ثم تصفية ما نحتاج إليه:
76
87``` js
98let links = document .querySelectorAll (' a' );
@@ -22,9 +21,9 @@ for (let link of links) {
2221}
2322```
2423
25- Please note: we use ` link.getAttribute('href') ` . Not ` link.href ` , because we need the value from HTML.
24+ يرجى ملاحظة ما يلي: نستخدم ` link.getAttribute ('href') ` . ليس ` link.href ` ، لأننا نحتاج إلى القيمة من HTML.
2625
27- ...Another, simpler way would be to add the checks to CSS selector :
26+ ... طريقة أخرى أبسط هي إضافة الشيكات إلى محدد CSS:
2827
2928``` js
3029// look for all links that have :// in href
@@ -34,3 +33,4 @@ let links = document.querySelectorAll(selector);
3433
3534links .forEach (link => link .style .color = ' orange' );
3635```
36+
Original file line number Diff line number Diff line change 1- importance : 3
1+ درجة الأهمية : 3
22
33---
44
5- # Make external links orange
5+ # اجعل الروابط الخارجية برتقالية
66
7- Make all external links orange by altering their ` style ` property .
7+ اجعل جميع الروابط الخارجية برتقالية من خلال تعديل خاصية `النمط 'الخاصة بها .
88
9- A link is external if :
9+ الرابط يعتبر خارجيا إذا :
1010- Its ` href ` has ` :// ` in it
1111- But doesn't start with ` http://internal.com ` .
1212
@@ -30,6 +30,7 @@ Example:
3030 </script >
3131```
3232
33- The result should be:
33+ النتيجة يجيب أن تكون:
3434
3535[ iframe border=1 height=180 src="solution"]
36+
You can’t perform that action at this time.
0 commit comments