jQuery学习笔记一

$(this).hide() - hides the current element.

$("p").hide() - hides all <p> elements.

$("p.test").hide() - hides all <p> elements with class="test".

$("#test").hide() - hides the element with id="test".


jQuery Effect Methods

The following table lists all the methods used to create animation effects.

MethodDescription
animate()Runs a custom animation (of a set of CSS properties) on selected elements
clearQueue()Removes all queued functions on selected elements
delay()Sets a delay for all queued functions on selected elements
dequeue()Runs the next queued functions on selected elements
fadeIn()Fades in selected elements
fadeOut()Fades out selected elements
fadeTo()Fades in/out selected elements to a given opacity
fadeToggle() 
hide()Hides selected elements
queue()Shows the queued functions on selected elements
show()Shows selected elements
slideDown()Slide-down (show) selected elements
slideToggle()Toggles slideUp() and slideDown() on selected elements
slideUp()Slide-up (hide) selected elements
stop()Stops a running animation on selected elements
toggle()Toggles between hide() and show(), or custom functions, on selected elements


jQuery HTML Methods  点击相应的方法会有对应的例子

The following table lists all the methods used to manipulate the DOM.

The methods below work for both HTML and XML documents. Exception: the html() method.

MethodDescription
addClass()Adds one or more classes (for CSS) to selected elements
after()Inserts content after selected elements    //重要
append()Inserts content at the end of (but still inside) selected elements//重要
appendTo()Inserts content at the end of (but still inside) selected elements
attr()Sets or returns an attribute and value of selected elements
before()Inserts content before selected elements  //重要
clone()Makes a copy of selected elements
detach()Removes (but keeps a copy of) selected elements
empty()Removes all child elements and content from selected elements
hasClass()Checks if any of the selected elements have a specified class (for CSS)
html()Sets or returns the content of selected elements  //重要
insertAfter()Inserts HTML markup or elements after selected elements
insertBefore()Inserts HTML markup or elements before selected elements
prepend()Inserts content at the beginning of (but still inside) selected elements  //重要
prependTo()Inserts content at the beginning of (but still inside) selected elements
remove()Removes selected elements
removeAttr()Removes an attribute from selected elements
removeClass()Removes one or more classes (for CSS) from selected elements
replaceAll()Replaces selected elements with new content
replaceWith()Replaces selected elements with new content
text()Sets or returns the text content of selected elements
toggleClass()Toggles between adding/removing one or more classes (for CSS) from selected elements
unwrap()Removes the parent element of the selected elements
val()Sets or returns the value attribute of the selected elements (form elements)
wrap()Wraps specified HTML element(s) around each selected element
wrapAll()Wraps specified HTML element(s) around all selected elements
wrapInner()Wraps specified HTML element(s) around the content of each selected element

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值