Skip to content

JQuery replaceWith() Example


JQuery replaceWith() Example

<!DOCTYPE html>
    <meta charset="utf-8" />
    <link rel="stylesheet" type="text/css" href="main.css">
    <link rel="stylesheet" href="">
    <script src=""></script>
    <script src=""></script>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="">
    <script src=""></script>
        <script src=""></script>
        <script src=""></script>


  <ul class="container">
    <h2 class="title">Normal List</h2>
      <li>Row 1</li>
      <li>Row 2</li>
      <li>Row 3</li>
      <li>Row 4</li>
      <li>Row 5</li>
      <button class="btn btn-warning">CLICK</button>


        $("h2").replaceWith("<h2>Bootstrap List</h2>")
          return "<p class='list-group-item'>" + $(this).html() + "</p>";



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: