1$(yourElement).html("New text");
2//sets yourElement innerHTML to "New text"
3var text = $(yourElement).html();
4//html() returns the text inside yourElement if you pass no parameters
1<!doctype html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <title>text demo</title>
6 <style>
7 p {
8 color: blue;
9 margin: 8px;
10 }
11 </style>
12 <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
13</head>
14<body>
15
16<p>Test Paragraph.</p>
17
18<script>
19$( "p" ).text( "<b>Some</b> new text." );
20</script>
21
22</body>
23</html>
24