Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • jQuery clone() Method

    • 0
    • 1
    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 345
    Comment on it

    The clone() method is used to make clone of the elements that are matching to the selected elements and select the clones.

    It basically makes copies of the selected DOM element to some other place in the DOM.




          <title>The jQuery clone method</title>
          <script type = "text/javascript" 
             src = ""></script>
          <script type = "text/javascript" language = "javascript">
             $(document).ready(function() {
                $(".one").click(function () {
             .one{margin:10px;padding:12px; border:2px solid #666; width:60px;}
          <p>Click on any of the box:</p>
          <div class = "one" style = "background-color:blue;"></div>
          <div class = "one" style = "background-color:red;"></div>
          <div class = "one" style = "background-color:yellow;"></div>

    When we click on any of the div element having class one it will insert a copy of that element after this.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: