Sunday, February 15, 2015

jQuery prepend and append method






The prepend() method inserts specified content at the beginning of the selected elements
and append method  is to insert content at the end of the selected elements.
Example
               $blockAll = $(" <input type='button' class='block all' value='Block All Salary \> 0' />");
                $("div.ajax_list").prepend($blockAll);

                $viewAllPdf = $("<input type='button' class='viewallpdf' value='Preview All Contracts with Salary \> 0 (May take up to 5 minutes)' />");
            $("div.ajax_list").prepend($viewAllPdf);


The button  viewallpdf will come first and blockall button comes after.

No comments:

Post a Comment