File tree Expand file tree Collapse file tree 5 files changed +120
-120
lines changed
2-ui/1-document/06-dom-attributes-and-properties Expand file tree Collapse file tree 5 files changed +120
-120
lines changed Original file line number Diff line number Diff line change 7
7
<div data-widget-name =" menu" >Choose the genre</div >
8
8
9
9
<script >
10
- // getting it
10
+ // অ্যাট্রিবিউট অনুসারে এলিমেন্ট সিলেক্ট
11
11
let elem = document .querySelector (' [data-widget-name]' );
12
12
13
- // reading the value
13
+ // ভ্যালু menu
14
14
alert (elem .dataset .widgetName );
15
- // or
15
+ // অথবা
16
16
alert (elem .getAttribute (' data-widget-name' ));
17
17
</script >
18
18
</body >
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ importance: 5
4
4
5
5
# Get the attribute
6
6
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 ` অ্যাট্রিবিউট এর এলিমেন্টটি সিলেক্ট করে অ্যাট্রিবিউটের মান পড়ার কোড লিখুন।
8
8
9
9
``` html run
10
10
<!DOCTYPE html>
Original file line number Diff line number Diff line change 1
1
2
- First, we need to find all external references.
2
+ প্রথমত, আমাদের সকল এক্সটার্নাল লিংক খুঁজে বের করতে হবে।
3
3
4
- There are two ways.
4
+ এটি দুইভাবে করতে পারি।
5
5
6
- The first is to find all links using ` document.querySelectorAll('a') ` and then filter out what we need :
6
+ প্রথমে আমরা সকল লিংক কে নিব ` document.querySelectorAll('a') ` এবং তারপর আমরা আমদের চাহিদামত ফিল্টার করব :
7
7
8
8
``` js
9
9
let links = document .querySelectorAll (' a' );
@@ -22,13 +22,13 @@ for (let link of links) {
22
22
}
23
23
```
24
24
25
- Please note: we use ` link.getAttribute('href') ` . Not ` link.href ` , because we need the value from HTML.
25
+ দয়া করে নোট রাখুন: আমরা ` link.getAttribute('href') ` ব্যবহার করব। ` link.href ` ব্যবহার করব না, কেননা আমাদের HTML ভ্যালুটি লাগবে।
26
26
27
- ...Another, simpler way would be to add the checks to CSS selector:
27
+ ...আরেকটি উপায় হল, CSS selector ব্যবহার করা :
28
28
29
29
``` js
30
- // look for all links that have :// in href
31
- // but href doesn't start with http://internal.com
30
+ // সকল লিংকের href এ :// খুঁজা
31
+ // কিন্তু href, http://internal.com দ্বারা শুরু হবে না
32
32
let selector = ' a[href*="://"]:not([href^="http://internal.com"])' ;
33
33
let links = document .querySelectorAll (selector);
34
34
Original file line number Diff line number Diff line change @@ -2,15 +2,15 @@ importance: 3
2
2
3
3
---
4
4
5
- # Make external links orange
5
+ # এক্সটার্নাল লিংক সমূহকে কমলা রঙয়ের করা
6
6
7
- Make all external links orange by altering their ` style ` property.
7
+ সকল এক্সটার্নাল লিংক সমূহকে কমলা রঙ করুন তাদের ` style ` প্রপার্টি পরিবর্তনের মাধ্যমে।
8
8
9
- A link is external if :
10
- - Its ` href ` has ` :// ` in it
11
- - But doesn't start with ` http://internal.com ` .
9
+ একটি লিংক এক্সটার্নাল হবে, যদি :
10
+ - ` href ` এ ` :// ` থাকে।
11
+ - তবে এভাবে শুরু হবে না ` http://internal.com ` ।
12
12
13
- Example :
13
+ যেমন :
14
14
15
15
``` html run
16
16
<a name =" list" >the list</a >
@@ -24,12 +24,12 @@ Example:
24
24
</ul >
25
25
26
26
<script >
27
- // setting style for a single link
27
+ // একটি লিংকের জন্য স্ট্যাইল সেট
28
28
let link = document .querySelector (' a' );
29
29
link .style .color = ' orange' ;
30
30
</script >
31
31
```
32
32
33
- The result should be :
33
+ এটি দেখতে এমন হবে :
34
34
35
35
[ iframe border=1 height=180 src="solution"]
You can’t perform that action at this time.
0 commit comments