Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("p").each(function(){
- // Add a div after the second <br /> (in the current <p>)
- $("br:eq(1)", this).after('<div class="theRest"> </ div>');
- // Split each "child" in an array
- $(this).contents().filter(function(index, elem){
- // Keep only children after the <div />
- return index > 3;
- // Remove and put them into the <div />
- }).detach().appendTo($(".theRest", this));
- });
- $('p').each(function() {
- $(this).contents(':gt(2)').wrap('<div class="theRest"></div>');
- });
- $('.father').find('p').each(function() {
- $(this).contents(':gt(2)').wrap('<div class="theRest"></div>');
- });
- $($("p").contents().get(2)).after('<div class="theRest"></div>');
- $("p").contents().filter(function(index, element) {
- return index > 3;
- }).detach().appendTo(".theRest");
- var txt = $('.txt').contents();
- txt.splice(0,1);
- txt.wrapAll($("<div>").addClass('red'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement