0% found this document useful (0 votes)
9 views

Javascript File

The documents demonstrate how to manipulate HTML elements and attributes using JavaScript and jQuery. This includes changing element text and styles, retrieving and displaying object properties, and animating element positions on events like clicks or key presses.

Uploaded by

royal01818
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Javascript File

The documents demonstrate how to manipulate HTML elements and attributes using JavaScript and jQuery. This includes changing element text and styles, retrieving and displaying object properties, and animating element positions on events like clicks or key presses.

Uploaded by

royal01818
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

<html>

<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>

------------------------------------------------------------

You might also like