Set paragraph text

Description

The following code shows how to set text for a selected paragraph with .text().

Example


<!DOCTYPE html>
<html>
<head>
<script
  src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">
  <!--from w  w w  . ja  va 2 s .c o m-->
</script>
<script>
  $(function() {
    $("p").text("updated value.");
  });
</script>
</head>
<body>
  <p>Blah</p>
</body>
</html>

Click to view the demo





















Home »
  jQuery »
    jQuery Example »




Animation
DOM
Event
Form
List
Select
Style
Table
Utilities