1<!DOCTYPE html>
2<html>
3<head>
4<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
5<script>
6$(document).ready(function(){
7 $("#btn1").click(function(){
8 $("#test1").text("Hello world!");
9 });
10 $("#btn2").click(function(){
11 $("#test2").html("<b>Hello world!</b>");
12 });
13 $("#btn3").click(function(){
14 $("#test3").val("Dolly Duck");
15 });
16});
17</script>
18</head>
19<body>
20
21<p id="test1">This is a paragraph.</p>
22<p id="test2">This is another paragraph.</p>
23
24<p>Input field: <input type="text" id="test3" value="Mickey Mouse"></p>
25
26<button id="btn1">Set Text</button>
27<button id="btn2">Set HTML</button>
28<button id="btn3">Set Value</button>
29
30</body>
31</html>
32
1<!DOCTYPE html>
2<html>
3<head>
4<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
5<script>
6$(document).ready(function(){
7 $("#btn1").click(function(){
8 $("#test1").text("Hello world!");
9 });
10 $("#btn2").click(function(){
11 $("#test2").html("<b>Hello world!</b>");
12 });
13 $("#btn3").click(function(){
14 $("#test3").val("Dolly Duck");
15 });
16});
17</script>
18</head>
19<body>
20
21<p id="test1">This is a paragraph.</p>
22<p id="test2">This is another paragraph.</p>
23
24<p>Input field: <input type="text" id="test3" value="Mickey Mouse"></p>
25
26<button id="btn1">Set Text</button>
27<button id="btn2">Set HTML</button>
28<button id="btn3">Set Value</button>
29
30</body>
31</html>