|
1 | 1 | # Events: change, input, cut, copy, paste |
2 | 2 |
|
3 | | -Let's cover various events that accompany data updates. |
| 3 | +بیایید eventهای مختلفی که همراه با آپدیت دادهها هستند پوشش دهیم. |
4 | 4 |
|
5 | 5 | ## Event: change |
6 | 6 |
|
7 | | -The `change` event triggers when the element has finished changing. |
| 7 | +وقنی که تغییر یک element تمام میشود، `change` event فعال میشود. |
8 | 8 |
|
9 | | -For text inputs that means that the event occurs when it loses focus. |
| 9 | +برای text inputها این یعنی که event زمانی اتفاق میافتد که focus را از دست میدهد. |
10 | 10 |
|
11 | | -For instance, while we are typing in the text field below -- there's no event. But when we move the focus somewhere else, for instance, click on a button -- there will be a `change` event: |
| 11 | +برای مثال وقتی که ما داریم در text field زیر تایپ میکنیم -- هیچ eventای وجود ندارد. اما وقتی focus را به جایی دیگر منتقل میکنیم، برای مثال، روی یک button کلیک میکنیم، یک `change` event به وجود خواهد آمد: |
12 | 12 |
|
13 | 13 | ```html autorun height=40 run |
14 | 14 | <input type="text" onchange="alert(this.value)"> |
15 | 15 | <input type="button" value="Button"> |
16 | 16 | ``` |
17 | 17 |
|
18 | | -For other elements: `select`, `input type=checkbox/radio` it triggers right after the selection changes: |
| 18 | +برای دیگر elementها: `select` و `input type=checkbox/radio` دقیقا بعد از آن که انتخاب تغییر میکند فعال میشود: |
19 | 19 |
|
20 | 20 | ```html autorun height=40 run |
21 | 21 | <select onchange="alert(this.value)"> |
22 | | - <option value="">Select something</option> |
23 | | - <option value="1">Option 1</option> |
24 | | - <option value="2">Option 2</option> |
25 | | - <option value="3">Option 3</option> |
| 22 | + <option value="">چیزی را انتخاب کنید</option> |
| 23 | + <option value="1">انتخاب 1</option> |
| 24 | + <option value="2">انتخاب 2</option> |
| 25 | + <option value="3">انتخاب 3</option> |
26 | 26 | </select> |
27 | 27 | ``` |
28 | 28 |
|
29 | 29 |
|
30 | 30 | ## Event: input |
31 | 31 |
|
32 | | -The `input` event triggers every time after a value is modified by the user. |
| 32 | +هر بار پس از آن که یک مقدار توسط کاربر تغییر میکند، `input` event فعال میشود. |
33 | 33 |
|
34 | 34 | Unlike keyboard events, it triggers on any value change, even those that does not involve keyboard actions: pasting with a mouse or using speech recognition to dictate the text. |
35 | 35 |
|
|
0 commit comments