��� ����: ����� ����� / ����� 5 / �� 11
 


������ �� ��� �- JavaScript
 


���� ������ ��:
1: ���� ������ 5
2: ���� ������
3: ���������� �����
4: ����� ���� �����
5: ���� �����
6: ������� ���� �����
7: CheckBoxes
8: ������ ����
9: ������
10: ����� onChange
11: ����� �� ����� 5
|
|
|
|
|
|
|
|
|
|
|
|

����� 5

�� 11: ����� �� ����� 5.

���� ������� ������ ������� ���. �� �� ����� ��:

����� ����� �������� ����.
    ��� ���� ������� ������� ����� ��:
    window.document.form_name.element_name;


������� ����� �� ��� �����, ������ ����� �� ������ ���.
    ��� ���� ������� ������� ���� ���� ��:
    window.document.form_name.element_name.value;
    ��� ���� ������ �� ������ ������ ��� �� ���� �� ����.


�������� �� ���� ���� ������ ����� ������ �� ������ ����� ��������: focus, blur �- change.
    ���� ��� ���� �� ����� ����� �����, ����� ����� ����� ��������. ����� �� ��� �������� ����� ������ ������ ������ �� ()blur. ����� �� ����� �- tab, �� �� ����� �-return ���� ����� �������� ����� ����� ()onChange.


������ �� ����� ������� �- ()onSubmit.
    �� ��� ����� ����� ������ ���� �� ��� ���� ��� ���� �� ����� �- submit ��� �� �- ";onSubmit=�return false ���� ������ <form>.


�- checkboxes �������� ���� �� ����� �����.
    ��� ���� ����� ����� �� ������ �- checkboxes ������� ����� �"� ����� ������ ������ ����.


�- checkboxes ������� ����� �� ����� �������, ���� �- ()onClick.
    ����� ��� �������, ��� ���� ����� ��������� ������ �����, ���� ������ ���� �� checkbox �� �� ����� ����.


������� �� ������ �� ��������, �������� �"� ���� �� �������� ������.
    ��� ����� ����, ���� ����� �� ���� ���������, �"� ����� ���� ���� ��������� �"�:
    window.document.form_name.select_name.options.length;


��� ���� ����� �� ���� ��������� �"� ������� �� ������ ����� ����.
    �� ��� ����� �� ����� �� ������ ������ ����� ��������� ����:
    window.document.form_name.select_name.options[0].text=�new text�;


��� ���� ���� ��� ������� ������, �"� ����� ������� ������ ������- selectedIndex, �� ������ �����.
    window.document.form_name.select_name.selectedindex
    ����� �� ���� �����, ���� ��� ���� �����:
    window.document.form_name.select_name.option[that_number ].text
    �� ��� ����� �� ������.


������� �� ����� ������� �- ()onChange.
    ���� ����� ���� ���� ������ ������, ����� �- onchange() ���� ������.


��� ���� ����� �� ���� �-URL.
    ���� ����� ��� ��� ����� ������� ����, �"�:
    window.location.replace(�new_url�);


��� ���� ����� ������ ���� ������� ������ �"� ����� �- "new Option".
    ����, ��� ������ ����� ��������-������ ��� �������, ��� ���� ����� ������ ����, ����� �� ������� ����� ����� ���������.


���� ��� ����, ���� 5 �������. ����� ����� ���� ���� ������ ����� �� ����� �����, ��� ����� ��� �� �- JavaScript DOM. ����� �� �����, ���� ��� ��� ��������� �- JavaScript ������ ����� �����. �� ������ ����� �� ����� ��������� �����, �� �� ������ ������ �� �������� �������.

�� �� �����, ���� ������ ���. ���, ���� ����� ����� ����� ����� ���, ��� ����� ����� ���� ���� ������ JavaScript ��������.

���� ������ ���

������ ������ «--

 
       
       
   
 
 

���� ����
����� �����
����� �����
����� ������
����� ���
��� ����