Javascript File
Javascript File
<head>
<body>
<p id="test">saurabh kushwaha</p>
<button type="button" onclick="document.getElementById('test').innerHTML='Rishabh
kushwaha'">click on me </button>
</body>
</head>
</html>
------------------------------------------------------------------
<html>
<head>
<script>
function saurabh()
{
document.getElementById('test').innerHTML="ANUJ";
}
</script>
</head>
<body>
<p id="test"></p>
<button type="button" onclick=saurabh();>click on me </button>
</body>
</html>
-------------------------------------------------------------------
<html>
<head>
<script>
function saurabh()
{
document.getElementById('test').innerHTML="SAURABH";
}
</script>
</head>
<body>
<p id="test"></p>
<button type="button" onclick=saurabh();>click on me </button>
</body>
</html>
--------------------------------------------------------------------
<html>
<head>
<body>
<p id="test"></p>p>
<script>
const student={
Name:"saurabh",
Age:18,
Address:"prayaraj",
Heigth:6
};
document.getElementById('test').innerHTML=student.Name+student.Age+student.Address+
student.Heigth;
</script>
</body>
</head>
</html>
------------------------------------------------------------------
<html>
<body>
<input type="text" id="tea" onkeydown="myfunction()" onkeyup="test()">
<script>
function myfunction(){
var x=document.getElementById("tea");
x.value=x.value.toUpperCase();
};
function test(){
document.getElementById("tea").style.backgroundColor="red";
};
</script>
</body>
</html>
----------------------------------------------------------------
<html>
<body>
<input type="text" id="tea" onkeydown="myfunction()" onkeyup="test()">
<script>
function myfunction(){
var x=document.getElementById("tea");
x.value=x.value.toUpperCase();
};
</script>
</body>
</html>
------------------------------------------------------------------
<html>
<head>
<script src="jquery-3.6.1.slim.min.js"></script>
<script>
$("document").ready(function(){
$("button").click(function(){
$("div").animate({left:'500px'})
});
});
</script>
</head>
<body>
<button type="button">button</button>
<div style="height:200px; width:200px; background-color:red; position:absolute;">
</div>
<div> </div>
</body>
</head>
</html>
------------------------------------------------------------