លំហាត់​អនុវត្តន៍​អំពី​ហេតុការណ៍


សំណួរ

១. នៅ​ក្នុង​ភាសា JS តើ «ហេតុការណ៍» គឺ​ជា​អ្វី​ទៅ​?
២. តើ​ហេតុការណ៍ JS មាន​ប្រយោជន៍​អ្វី​ខ្លះ​ដែរ?
៣. តើ​វិធី​អ្វី​ខ្លះ​ដែល​អាច​អនុញ្ញាត​អោយ​យើង​សរសេរ​កម្មវិធី​ជា​ភាសា JS ​បង្កើត​ហេតុការណ៍​និង​ឬ​លុប​ហេតុការណ៍​នៅ​លើ​ធាតុ HTML ផ្សេង​ៗ?
៤. អ្វី​ទៅ​ជា​ក្បួន​ឬ​វិធី​ឆ្លើយតប​ហេតុការណ៍ (event handler) ?
៥. តើ​វត្ថុ​នៃ​ហេតុការណ៍ (event object) គឺ​ជា​អ្វី​ និង​ត្រូវ​កើត​ឡើង​នៅ​ពេល​ណា​?
៦. តើ​ត្រូវ​ធ្វើ​ដូចម្តេច ដើម្បី​ហាម​ឃាត់​ការយក​វិធី​ឆ្លើយតប​ហេតុការណ៍​មាន​ស្រាប់​មក​ប្រើ​ដោយ​ស្វ័យ​ប្រវត្តិ?

លំហាត់​អនុវត្តន៍

Task 1

Create an html page for entering the user name. It is necessary to check every character that the user enters. If they entered a digit, then do not display it in input.


Task 2

Create an html page with an Open button and a modal window. Modal window should contain a text and a Close button.
Modal window is not displayed initially. Modal window appears by clicking on the Open button and disappears by clicking on the Close button.


Task 3

Create an html page with several buttons. When hovering over a button, a tip with text should appear. By default, the tip appears above the button. But if it does not fit there, then it is displayed below the button.


Task 4

Create an html page with tabs. Several tabs are displayed on the left side of the page, and you can switch between them. Each tab has its own content, but the content of the active tab only is displayed at a single point in time.


Task 5

Create an html page with progressbar and a button. When it is clicked, the progressbar fullness is increased by 5%.