jquery :$("element").html() .text() .apendTo()
阿新 • • 發佈:2018-12-15
- jQuery has a function called appendTo() that allows you to select HTML elements and append them to another element.
$("#target2").appendTo("#right-well");
- 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");
- 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" );