Assignment 4
Assignment 4
Assignment 4
4
Lohade Om Manoj (SEDA IT C) (Roll No. 3)
I. HTML FILE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="Operations.js"></script>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1 id="heading">String Functions in Javascript:</h1>
<form >
<label for="strinp" id="label1">Enter Your Name : </label>
<input type="text" id="strinp" placeholder="Enter Your Name">
<br><br>
<input type="button" class="buttons" value="Submit"
onclick="display('strinp')">
</form>
<h3 id="strlen"></h3>
<h3 id="firstname"></h3>
<h3 id="substring"></h3>
<h3 id="substr"></h3>
<h3 id="replace"></h3>
<h3 id="upper"></h3>
<h3 id="lower"></h3>
<h3 id="concat"></h3>
<h3 id="trim"></h3>
<h3 id="characterat"></h3>
<h3 id="charcodeat"></h3>
<h3 id="splitstr"></h3>
</body>
</html>
II. CSS FILE (styles.css)
#heading{
text-align: center;
}
#label1{
font-size: x-large;
}
#strinp{
width: 250px;
height: 20px;
font-size: large;
}
.buttons{
width: 100px;
background: #e3362c;
color: #fff;
padding-left: 12px;
padding-right: 12px;
padding-top: 5px;
padding-bottom: 5px;
margin: 10px;
border-radius: 5px;
cursor:pointer;
text-align: center;
font-size: large;
}
let t1 = val.slice(0,5);
let t2 = val.substr(12,6);
return;
}
OUTPUT:
2) Array Methods in Javascripts
I. HTML FILE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Arrays</title>
<script src="operations.js"></script>
</head>
<body>
<h1 style="text-align: center;">Array Functions in Javascript:</h1><br>
<h3>Array : [10, 15, 20, 25, 30]</h3><br>
<h3 id="arrlen"></h3>
<h3 id="tostring"></h3>
<h3 id="pop"></h3>
<h3 id="push"></h3>
<h3 id="shift"></h3>
<h3 id="unshift"></h3>
<h3 id="concat"></h3>
<h3 id="splice"></h3>
<h3 id="slice"></h3>
</body>
</html>
arr.splice(2,0,17);
OUTPUT:
3) Date Methods in JavaScript
I. HTML FILE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Date</title>
<script src="operation.js"></script>
</head>
<body>
<h1 style="text-align: center;">Date Functions in JavaScript</h1>
<input type="button" value="Click" onclick="display()"></button>
<h3 id="disp1"></h3>
<h3 id="disp2"></h3>
<h3 id="disp3"></h3>
<h3 id="disp4"></h3>
<h3 id="disp5"></h3>
<h3 id="disp6"></h3>
<h3 id="disp7"></h3>
<h3 id="disp8"></h3>
<h3 id="disp9"></h3>
</body>
</html>
OUTPUT:
4) Math Methods in JavaScript
I. HTML FILE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Math</title>
<link rel="stylesheet" href="styles.css">
<script src="action.js"></script>
</head>
<body>
<h1 style="text-align: center;">Array Functions in
Javascript:</h1><br>
<form >
<label for="numinp" id="label1">Enter A Number : </label>
<input type="number" id="numinp" placeholder="Enter a Number">
<br><br>
<input type="button" class="buttons" value="Submit"
onclick="display('numinp')">
<h3 id="disp1"></h3>
<h3 id="disp2"></h3>
<h3 id="disp3"></h3>
<h3 id="disp4"></h3>
<h3 id="disp5"></h3>
<h3 id="disp6"></h3>
<h3 id="disp7"></h3>
<h3 id="disp8"></h3>
<h3 id="disp9"></h3>
<h3 id="disp10"></h3>
<h3 id="disp11"></h3>
<h3 id="disp12"></h3>
<h3 id="disp13"></h3>
<h3 id="disp14"></h3>
</form>
</body>
</html>
font-size: x-large;
}
#numinp{
width: 250px;
height: 20px;
font-size: large;
}
.buttons{
width: 100px;
background: #e3362c;
color: #fff;
padding-left: 12px;
padding-right: 12px;
padding-top: 5px;
padding-bottom: 5px;
margin: 10px;
border-radius: 5px;
cursor:pointer;
text-align: center;
font-size: large;
}
OUTPUT: