20180503 jq learning record (jquery operation style sheet, time slice, transfer between jq object functions)

 jquery manipulate dom object

   1.1 Dynamically add and delete a dom object

            Add : var new object = document.createElemente("label"");

                   $(object preposition parent object).append(new object) //adding completed //

            Delete : $(new object).remove() //delete complete//

   1.2 Dynamic manipulation of object css

           Set css: $(object).css('css property', 'style value') 

 

Additional little knowledge:

  1, about timer operation 

   var obj= setInerval(function(){operator, you can execute clearInterval(obj) at any time to destroy this timer}, time interval)

 2. About passing objects between functions as parameters

   $(object).click(function(){ function so-and-so (this)}) //Example: The click has been executed, and an operation is performed. The content of the operation is to execute a function called function so-and-so, and use the current object passed as a parameter.

    The function XX(self){ $(self).XXX()} self is the content of self passed in

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325224921&siteId=291194637