Friday 26 September 2014

Push method for javascript array

JavaScript Array pop() Method
var actors = ["Rajini", "Kamal", "Ajith", "Vijay"];
actors.push("Surya");
The result of fruits will be:
Rajini,Kamal,Ajith,Vijay,Surya

To remove array Last index value Javascript

JavaScript Array pop() Method
var actors = ["Rajini", "Kamal", "Ajith", "Vijay"];
actors.pop();
The result of fruits will be:
Rajini,Kamal,Ajith

Thursday 25 September 2014

How to add segment insertAfter specific id in jQuery?

<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("<p id=3>Hello world!</p>").insertAfter("#1"); }); }); </script> </head> <body> <button>Insert span element after each p element</button> <p id="1">This is a paragraph.</p> <p>This is another paragraph.</p> </body> </html>