Use after() method to add the text "How are you?" after the <p> element. - Javascript jQuery

Javascript examples for jQuery:Text

Description

Use after() method to add the text "How are you?" after the <p> element.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("p").after("How are you?");
});//  ww  w  .  j a va2  s .  c o m
</script>
</head>
<body>

<p>Hello?</p>

</body>
</html>

Related Tutorials