L008 ABCA Exp7
L008 ABCA Exp7
PART A
(PART A : TO BE REFFERED BY STUDENTS)
A.1 Aim:
Write code in Javascript to implement repetitive actions in the event of clicking a checkbox.
Write a code in Jquery to implement the action requiring repetitive validations, on the event
of clicking a button.
A.2 Prerequisite:
1. Fundamental concepts of HTML, Javascript and JQuery.
A.3 Outcome:
After successful completion of this experiment students will be able to
A.4 Theory:
A.4.1. Introduction to JQuery :
JQuery is basically a wrapper built on top of Javascript.
It is a manipulator of the Document Object Model (DOM).
It shortens Javascript code to find elements of a type and to manipulate events
centered around them.
It is written in Javascript itself and is recognized by most popular browsers.
It helps in separating event handlers from HTML code.
A.5 Tasks / Procedures:
Using HTML, implement a simple tabular page containing the following columns:
TASK 1:
At the bottom there must be a button labelled “Submit”. Using Javascript, write a function to
execute upon the event of clicking the checkbox “Select All” on top. If this checkbox is checked,
all the checkboxes below it must be checked, and vice-versa.
TASK 2:
Using JQuery, write a validation upon the click of the button, “Submit”. If this button is clicked
and none of the checkboxes against their respective rows are checked, it must alert the user to
select at least 1 checkbox.
PART B
(PART B : TO BE COMPLETED BY STUDENTS)
Students must submit the soft copy as per following segments within two hours of the practical.
The soft copy must be uploaded on the portal at the end of the practical. The filename should be
ABCA_batch_rollno_experimentno Example: ABCA_E2_E001_Exp1
Task 1:
<!DOCTYPE html>
<html>
<head>
<title>Checkbox Example</title>
</head>
<body>
<input type="checkbox" id="selectAll"> Select All<br>
<input type="checkbox" class="checkbox"> Checkbox 1<br>
<input type="checkbox" class="checkbox"> Checkbox 2<br>
<input type="checkbox" class="checkbox"> Checkbox 3<br>
<button id="submitBtn">Submit</button>
<script>
document.addEventListener("DOMContentLoaded", function() {
const selectAllCheckbox = document.getElementById("selectAll");
const checkboxes = document.querySelectorAll(".checkbox");
const submitButton = document.getElementById("submitBtn");
Task 2:
<html>
<head>
<title> Hehehehhe </title>
<style>
body
background: rgb(2,0,36);
border-style: groove;
margin: 250;
.button {
color: gray;
border-radius: 12px;
text-align: center;
display: inline-block;
font-size: 16px;
margin-top: 25px;
h1{
margin-top: 140px;
text-align: center;
font-size: 45px;
.MyDiv{
margin-top: 25px;
text-align: center;
font-size: 20px;
</style>
</head>
<body>
<div class="myDiv">
<br> <br>
<br>
<br>
<br>
</div>
<script>
function resetData(){
document.getElementById("uid").value=""
document.getElementById("ups").value=""
function submitData(){
var x = document.getElementById("uid").value;
var y = document.getElementById("ups").value;
if (x == "" || y == "") {
return false;
</script>
</body>
</html>
Task 1:
Task 2:
B.3 Conclusion:
(Students must write the conclusion as per the attainment of individual outcome listed above and
learning/observation noted in section B.3. It must be purely based on personal learning only.)
1. I could write code in Javascript for repetitive actions to be taken on events like
clicking on HTML elements like checkboxes and buttons.
2. I was able to write code in JQuery to implement repetitive actions on
events.
B.4 Question of Curiosity
(To be answered by student based on the practical performed and learning/observations. Students
are free to explore the websites, books etc to answer these questions)
************************