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

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 161
    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.

    <!DOCTYPE html>
    <html>
    <head>
    	<title>append() property</title>
    	  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
    </head>
    <body>
    	<p><button type="button">add more settings</button></p>
    </body>
    <script type="text/javascript">
    	$(document).ready(function(){
    		$("button").click(function(){
    			alert('asdf');
    			$("body p").append('<div><label>enter phone no.</label><input type="text"></div>');/*it adds block of element inside <p> tag*/
    		});
    	});
    </script>
    </html>

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
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: