jquery :$("element").html() .text() .apendTo()

  1. jQuery has a function called appendTo() that allows you to select HTML elements and append them to another element.

    $("#target2").appendTo("#right-well");
  2. jQuery has a function called clone() that makes a copy of an element.Did you notice this involves sticking two jQuery functions together? This is called function chaining and it’s a convenient way to get things done with jQuery.

    $("#target2").clone().appendTo("#right-well");
  3. jQuery uses CSS Selectors to target elements. target:nth-child(n) css selector allows you to select all the nth elements with the target class or element type.Here’s how you would give the third element in each well the bounce class:
//target is a class name
$(".target:nth-child(3)").addClass("animated bounce");

猜你喜欢

转载自blog.csdn.net/sinat_33408089/article/details/79802666
今日推荐