国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

jQuery DOM nodes and node properties

You can easily obtain DOM nodes through JavaScript to perform a series of DOM operations. But in fact, most developers are accustomed to defining the HTML structure first, but this is very inflexible.

Imagine this situation: If we can determine the structure after obtaining the data through AJAX, this situation requires dynamic processing of nodes

This article will introduce to you how to use JavaScript Creating a div node element mainly includes two parts: creating the attributes of the div node element and creating the style of the div node element. I believe that the introduction in this article will definitely help you gain something.

Creation of nodes

Creation process: ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

Continuing Learning
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script> <script> $(function(){ var $li1 = $("<li>php中文網(wǎng)</li>"); //創(chuàng)建第一個li 標簽 var $li2 = $("<li>php.cn</li>"); //創(chuàng)建第二個li 標簽 $("ul").append($li1); //添加到<ul>節(jié)點中,<ul>節(jié)點是<li>的父節(jié)點 }) </script> </head> <body> <ul></ul> </body> </html>
submitReset Code