Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • append( ) property

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 209
    Comment on it

     append( ) property is used to insert a block of elements inside a particular element. It helps in adding block of element during runtime.This property insert's content, specified by the parameter, to the end of each element in the set of matched elements.

    1. <!DOCTYPE html>
    2. <html>
    3. <head>
    4.     <title>append() property</title>
    5.      <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
    6. </head>
    7. <body>
    8.     <p><button type="button">add more settings</button></p>
    9. </body>
    10. <script type="text/javascript">
    11.     $(document).ready(function(){
    12.         $("button").click(function(){
    13.             alert('asdf');
    14.             $("body p").append('<div><label>enter phone no.</label><input type="text"></div>');/*it adds block of element inside <p> tag*/
    15.         });
    16.     });
    17. </script>
    18. </html>

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: