jQuery Note 4 - jQuery object function function []

jQuery object function [function]

一.show() & hide():

show (you can add time): responsible for letting all related objects dom jQuery object contains a label that is displayed in the browser: style = "display: block"

hide (you can add time): responsible for letting all related objects dom jQuery object contains a label that is hidden in the browser: style = "display: none"

二.empty() & remove():

empty: the current sub-tab cleanup process

remove: the current label and its sub-label be deleted

三.append()&appendTo():

1. common: both innerHTML tag: Add a sub-label for the current label

2.append (): parent tag .append (sub-labels): father found himself a son 

   appendTo (): sub-tab .append (the parent tag): son gave himself a father

Properties operation functions

1.val function: operation target value

1) $ obj.val (): read the value attribute] [jQuery object first object dom

2) $ obj.val (value): unified assigned to jQuery object attributes all value

2.prop function: Work state property checked, disabled, selected

1) $ obj.prop ( "checked", true): for the jQuery object property values ​​checked all objects dom assignment to true

Value read [the checked properties] dom the jQuery object first object: 2) $ obj.prop ( "checked")

3.attr functions: basic properties id name title rowspan

1) $ obj.attr ( "name", "ck"): unified assignment to [name attribute] jQuery object all the dom object to ck

2) $ obj.attr ( "title"): read a first object jQuery object dom [title attribute] values

4.text function: the innerText operational attributes: label text binocular display content <div> 123 </ div>

1) $ obj.text ( "123"): unified jQuery object attributes assigned innerText all the dom object to 123

2) $ obj.text (): read the content attribute innerText jQuery object dom all objects, stitching returns a string

Guess you like

Origin www.cnblogs.com/wwww2/p/12129917.html