Skip to main content

Posts

Bài tập 3: nhập 2 số a, b so sánh kết quả so sánh của 2 số vừa nhập

<html> <head> <meta charset="utf-8"></meta> <title>Untitled Document</title> </head> <body> <script type="text/javascript"> a=5; b=7; //Cach 1: if...else: if(a>b) document.write("a > b"); else  if(a<b) document.write("a < b"); else document.write("a = b"); //Cach 2: if khong else: if(a>b) document.write("a > b"); if(a<b) document.write("a < b"); if(a==b) document.write("a = b"); </script> </body> </html> Untitled Document

Bài tập 2: Tạo bảng trong Javascript ("+a+")

<!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <script type="text/javascript"> a=5; b=7; document.write("<table border='1' width='700'>"); document.write("<tr><td></td><td>+</td><td>-</td><td>*</td><td>/</td></tr>"); document.write("<tr><td>a="+a+"</td><td rowspan='2'>"+(a+b)+"</td><td rowspan='2'>"+(a-b)+"</td><td rowspan='2'>*</td><td rowspan='2'>"+(a/b)+"</td></tr>"); document.write("<tr><td>b="+b+"</td></tr>"); document.write("</table>"); </script> </body> </html> Untitled Document

29/4/2021 JAVASCRIPT

<html> <head> <meta charset="utf-8"></meta> <title>Javascript</title> </head> <body> <script type="text/javascript"> // Chu thich cho 1 dong /* cho nhieu dong*/ document.write("<p align='center'>Hello <b>abc</b></p>"); document.write("Hello xyz"); document.write("<table border='1' width='500'>"); document.write("<tr><td>Ten</td><td>Tuoi</td></tr>"); document.write("<tr><td>Ti</td><td>17</td></tr>"); document.write("</table>"); //Bien: a=5; var d; b=7; c="hello"; document.write("Gia tri cua bien c la:"); document.write(c); //Phep noi chuoi: + document.write("<br/>Gia tri cua bien a la:<b>"+a+"</b>"); d=a+b; document.write("<br/>Gia tri cua bien d:...

Tạo bảng thầy cho về nhà làm

Untitled Document BINH LUAN Ten cua ban So dien thoai Email Tieu de bai viet   < Noi dung bai viet     File dinh kem   Gui bai Hinh anh     Word     <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <style> </style> </head> <body> <form id="form1" name="form1" method="post">   <table width="100%" border="0">     <caption>       BINH LUAN     </caption>     <tbody>       <tr>       ...

FORM

LAB Form 1.       Tạo trang html mới, lưu với tên form1.html 2.       Vào menu Insert è Form è Form (hoặc Insert bar è tab Form è Form) 3.       Nhắp chuột trong vùng form , chèn table 2 cột, 10 hàng, cellpadd=4, border=1, width=500, cellspace=0, caption= ĐĂNG KÝ THẢNH VIÊN CLB YÊU NHẠC 4.       Nhắp ở cột trái rồi gõ vào các nhãn : 5.       Nhắp ô phía sau Họ tên, chèn textfield ID= hoten 6.       Nhắp ô phía sau Tên đang nhập, chèn textfield ID= username 7.       Nhắp ô phía sau Mật khẩu, chèn textfield ID= pass ,   Type= Password 8.       Nhắp ô phía sau Gõ lại mật khẩu, chèn textfield ID= repass ,   Type= Password 9.       Nhắp ô phía sau Phái, chèn radio group tên= phai , 2 mục Nam =0, Nữ=1 10.   Nh...

Cách viết CSS đơn giản, gọn nhẹ cho website

 

Kết hợp các CSS

  LAB CSS   1.      Mở  file dulich.html 2.      Đặt tên cho table chứa chữ Danh làm các thắng cảnh là   danhlam 3.      Tuần tự tạo các style sau : #danhlam { width: 500px;    border: 5px solid #C60; } #danhlam caption {    color: #9F9;  text-transform: capitalize;  font-size: 18px;    background-color: #C60;  padding-top: 5px;  padding-bottom: 5px;} #danhlam  a {    color: #036; text-decoration: none;  padding-left: 25px;    background-image: url(forward1.gif); background-repeat: no-repeat; } #danhlam td { border-bottom: dotted 1px #C60;} 4.      Tạo class sau: #danhlam .vien {    border-left: dotted 1px #C60; border-right: dotted 1px #C60; }     Xong thì set class cho các td ở cột giữa    Kết quả như sau:   5.      Chèn...