{"id":166109,"date":"2013-01-17T17:41:04","date_gmt":"2013-01-17T13:41:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=166109"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=166109","title":{"rendered":"<span class=\"post_title\">\u0427\u0442\u043e \u043d\u0430\u043c \u0441\u0442\u043e\u0438\u0442 DOM \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0421\u043a\u0430\u0436\u0443 \u0441\u0440\u0430\u0437\u0443, \u0432\u0441\u044e DOM-\u043c\u043e\u0434\u0435\u043b\u044c \u043c\u044b \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u0430 \u043b\u0438\u0448\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438 \u043a\u0430\u043a \u0441 \u043d\u0438\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 jQuery. \u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0438\u043b\u0438 \u0442\u0435\u0445 \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u00ab\u043d\u0430 \u043b\u0435\u0442\u0443\u00bb, \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043a\u043e\u043c\u0443-\u0442\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e.<br \/>   \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438\u0437 js, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e ajax \u0438\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435. \u041d\u043e \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u0441 \u0432\u0430\u0448\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0418 \u0447\u0430\u0441\u0442\u043e \u0434\u0430\u0436\u0435 \u0432 \u043e\u0447\u0435\u043d\u044c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u043a\u043e\u0434 \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430:<\/p>\n<pre><code class=\"javascript\">var content = &quot;&lt;table&gt;&quot; for(i=0; i&lt;3; i++){     content += '&lt;tr&gt;&lt;td&gt;' + 'result ' +  i + '&lt;\/td&gt;&lt;\/tr&gt;'; } content += &quot;&lt;\/table&gt;&quot;  $('#table').append(content); <\/code><\/pre>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u043a\u043e\u0434\u0430 \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430 \u0431\u044b\u0441\u0442\u0440\u0443\u044e \u0440\u0443\u043a\u0443, \u044f \u0438 \u0441\u0430\u043c \u0442\u0430\u043a \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u0434\u0435\u043b\u0430\u043b, \u043d\u043e \u0432\u0435\u0434\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u043b\u0443\u0447\u0448\u0435.<br \/>   \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0432\u044b\u0432\u0435\u043b \u0441\u0430\u043c\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0432\u0430\u043c \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f.<br \/>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412\u043e\u0442 \u0435\u0449\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<pre><code class=\"javascript\">function createTable() {             $(&quot;#dynamicTable&quot;).append(&quot;&lt;table&gt;&quot;);             $(&quot;#dynamicTable&quot;).append(&quot;&lt;caption&gt;My table&lt;\/caption&gt;&quot;);             $(&quot;#dynamicTable&quot;).append(&quot;&lt;thead&gt;&quot;);             $(&quot;#dynamicTable&quot;).append(&quot;&lt;tr&gt;&quot;);             $(&quot;#dynamicTable&quot;).append(&quot;&lt;th&gt;A&lt;\/th&gt;&quot;);             $(&quot;#dynamicTable&quot;).append(&quot;&lt;th&gt;B&lt;\/th&gt;&quot;);             $(&quot;#dynamicTable&quot;).append(&quot;&lt;th&gt;C&lt;\/th&gt;&quot;);             $(&quot;#dynamicTable&quot;).append(&quot;&lt;\/tr&gt;&quot;);             $(&quot;#dynamicTable&quot;).append(&quot;&lt;\/thead&gt;&quot;);                          $(&quot;#dynamicTable&quot;).append(&quot;&lt;tbody&gt;&quot;); .... } <\/code><\/pre>\n<p>  \u0421\u043b\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u044d\u0442\u043e \u043a\u043e\u0434 \u0438\u043b\u0438 \u043d\u0435\u0442, \u043d\u043e \u043e\u043d \u044f\u0432\u043d\u043e \u043d\u0435\u0434\u0440\u0443\u0436\u0435\u043b\u044e\u0431\u043d\u044b\u0439. \u0412\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441 \u0447\u0438\u0441\u0442\u043e\u0433\u043e javascript, \u0447\u0442\u043e \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0430\u043c jQuery, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043f\u043e\u0440\u0438\u0442\u044c \u043e \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430, \u044f \u043d\u0435 \u0437\u0430\u043c\u0435\u0440\u044f\u043b \u0440\u0430\u0437\u043d\u0438\u0446\u0443, \u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f, \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043a\u043e\u0434\u0443.<\/p>\n<h2>Div<\/h2>\n<p>  <\/p>\n<pre><code class=\"javascript\">var mydiv = $('&lt;div\/&gt;', {     id:     'mydiv',     class:  'mydiv',     text: \t'\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0431\u043b\u043e\u043a\u0430'  }); $('.content').append(mydiv); <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:  <\/p>\n<pre><code class=\"html\">&lt;div class=&quot;mydiv&quot; id=&quot;mydiv&quot;&gt;\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0431\u043b\u043e\u043a\u0430&lt;\/div&gt; <\/code><\/pre>\n<p><a href=\"http:\/\/jsfiddle.net\/95HJt\/\">\u0414\u0435\u043c\u043e<\/a><\/p>\n<h3>Form<\/h3>\n<p>  <\/p>\n<pre><code class=\"javascript\">var myform = $(&quot;&lt;form\/&gt;&quot;, {   \taction: &quot;\/&quot;,  }).appendTo('.content'); <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:  <\/p>\n<pre><code class=\"html\">&lt;form action=&quot;\/&quot;&gt;&lt;\/form&gt; <\/code><\/pre>\n<p><a href=\"http:\/\/jsfiddle.net\/BP5YF\/\">\u0414\u0435\u043c\u043e<\/a><\/p>\n<h3>Input<\/h3>\n<p>  <\/p>\n<pre><code class=\"javascript\">$('&lt;input\/&gt;', {     id:     'myinput-1',     class:  'myinput',     type: \t'text',     name: \t'myinput-1',     val: \t'Habr',     css: {             'border': '1px solid red'     }  }).appendTo(myform); <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0438 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"javascript\">$('&lt;input\/&gt;').attr({     id:     'myinput-2',     class:  'myinput',     type: \t'text',     name: \t'myinput-2',     placeholder: \t'\u041f\u043e\u0438\u0441\u043a...' }).appendTo(myform); <\/code><\/pre>\n<pre><code class=\"javascript\">$('&lt;input\/&gt;', {     type: \t'submit',     name: \t'send',     val: \t'\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c'  }).appendTo(myform); <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:  <\/p>\n<pre><code class=\"html\">&lt;form action=&quot;\/&quot;&gt; \t&lt;input style=&quot;border: 1px solid red;&quot; name=&quot;myinput-1&quot; class=&quot;myinput&quot; id=&quot;myinput-1&quot; type=&quot;text&quot;&gt; \t&lt;input placeholder=&quot;\u041f\u043e\u0438\u0441\u043a...&quot; name=&quot;myinput-2&quot; class=&quot;myinput&quot; id=&quot;myinput-2&quot; type=&quot;text&quot;&gt; \t&lt;input value=&quot;\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c&quot; name=&quot;send&quot; type=&quot;submit&quot;&gt; &lt;\/form&gt; <\/code><\/pre>\n<p><a href=\"http:\/\/jsfiddle.net\/BP5YF\/\">\u0414\u0435\u043c\u043e<\/a><\/p>\n<h3>Select<\/h3>\n<p>  <\/p>\n<pre><code class=\"javascript\">var myselect = $('&lt;select\/&gt;', { id: 'myselect'}); var items = [&quot;Google&quot;,&quot;Yandex&quot;,&quot;Bing&quot;]; \/\/\u041d\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a $.each(items,function() { \t$('&lt;option\/&gt;', { \t\tval:  this, \t\ttext: this \t}).appendTo(myselect); }); myselect.val('Yandex'); $('.content').append(myselect); <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:  <\/p>\n<pre><code class=\"html\">&lt;select id=&quot;myselect&quot;&gt; \t&lt;option value=&quot;Google&quot;&gt;Google&lt;\/option&gt; \t&lt;option value=&quot;Yandex&quot;&gt;Yandex&lt;\/option&gt; \t&lt;option value=&quot;Bing&quot;&gt;Bing&lt;\/option&gt; &lt;\/select&gt; <\/code><\/pre>\n<p><a href=\"http:\/\/jsfiddle.net\/dA8rv\/\">\u0414\u0435\u043c\u043e<\/a><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u0433\u0434\u0435-\u0436\u0435 \u043d\u0430\u0448 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 selected?<br \/>  <i>\u0417\u0430\u043c\u0435\u043d\u0438\u043c: <\/i><br \/>  <code>myselect.val('Yandex');<\/code> <br \/>  <i>\u043d\u0430:<\/i><br \/>  <code>$('option[value=&quot;Yandex&quot;]', myselect).attr('selected', 'selected');<\/code><br \/>  \u0418 \u0432\u0441\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438, \u0445\u043e\u0442\u044f \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e<\/p>\n<pre><code class=\"html\">&lt;select id=&quot;myselect&quot;&gt; \t&lt;option value=&quot;Google&quot;&gt;Google&lt;\/option&gt; \t&lt;option selected=&quot;selected&quot; value=&quot;Yandex&quot;&gt;Yandex&lt;\/option&gt; \t&lt;option value=&quot;Bing&quot;&gt;Bing&lt;\/option&gt; &lt;\/select&gt; <\/code><\/pre>\n<h3>Radio<\/h3>\n<p>  <\/p>\n<pre><code class=\"javascript\">var myradiodiv = $('&lt;div\/&gt;', {     id:     'myradiodiv' }).appendTo(&quot;.content&quot;); var items = [&quot;Google&quot;,&quot;Yandex&quot;,&quot;Bing&quot;]; $.each(items, function(i,item) { \t$('&lt;label\/&gt;').append( \t\t$('&lt;input\/&gt;', { \t\t\ttype: 'radio', \t\t\tname: 'myradio', \t\t\tval: \titem \t\t}) \t).append(item).appendTo(myradiodiv); }); <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:  <\/p>\n<pre><code class=\"html\">&lt;div id=&quot;myradiodiv&quot;&gt; \t&lt;label&gt;Google \t\t&lt;input value=&quot;Google&quot; name=&quot;myradio&quot; type=&quot;radio&quot;&gt; \t&lt;\/label&gt; \t&lt;label&gt;Yandex \t\t&lt;input value=&quot;Yandex&quot; name=&quot;myradio&quot; type=&quot;radio&quot;&gt; \t&lt;\/label&gt; \t&lt;label&gt;Bing \t\t&lt;input value=&quot;Bing&quot; name=&quot;myradio&quot; type=&quot;radio&quot;&gt; \t&lt;\/label&gt; &lt;\/div&gt; <\/code><\/pre>\n<p><a href=\"http:\/\/jsfiddle.net\/hQ6z5\/\">\u0414\u0435\u043c\u043e<\/a><\/p>\n<h3>Button<\/h3>\n<p>  <\/p>\n<pre><code class=\"javascript\">var mybutton = $('&lt;button\/&gt;', {     text: 'Click Me',     click: function () { alert('Hello Habr'); } }).appendTo('.content'); <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:  <\/p>\n<pre><code class=\"html\">&lt;button&gt;Click Me&lt;\/button&gt; <\/code><\/pre>\n<h3>Iframe<\/h3>\n<p>  <\/p>\n<pre><code class=\"javascript\">$('&lt;iframe\/&gt;', {     name: 'myframe',     id:   'myframe',     src:  'about:blank' }).appendTo('.content'); <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:  <\/p>\n<pre><code class=\"html\">&lt;iframe src=&quot;about:blank&quot; id=&quot;myframe&quot; name=&quot;myframe&quot;&gt;&lt;\/iframe&gt; <\/code><\/pre>\n<h3>Table<\/h3>\n<p>  <code>&lt;tfoot&gt;<\/code> \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e <code>&lt;thead&gt;<\/code> \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u044f \u0435\u0433\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b<\/p>\n<pre><code class=\"javascript\">\/\/\u0414\u0430\u043d\u043d\u044b\u0435 var TableTitle = [&quot;Site&quot;, &quot;Google&quot;,&quot;Yandex&quot;,&quot;Bing&quot;]; var TableValue = [ \t[&quot;http:\/\/habr.ru\/&quot;,&quot;4&quot;,&quot;6&quot;,&quot;26&quot;], \t[&quot;http:\/\/habrahabr.ru\/&quot;,&quot;3&quot;,&quot;1&quot;,&quot;6&quot;], \t[&quot;http:\/\/google.ru\/&quot;,&quot;1&quot;,&quot;1&quot;,&quot;1&quot;] ]; \/\/\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 var mytable = $('&lt;table\/&gt;',{ \t\t\t\t\tclass:'mytable' \t\t\t\t}).append( \t\t\t\t\t$('&lt;thead\/&gt;'), \t\t\t\t\t$('&lt;tfoot\/&gt;'), \t\t\t\t\t$('&lt;tbody\/&gt;') \t\t\t\t); \/\/\u041d\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0443 \/\/\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a var TitleCell = $('&lt;tr\/&gt;'); $.each(TableTitle,function( myIndex, myData ) { \tTitleCell.append( \t\t$('&lt;th\/&gt;',{ \t\t\ttext:myData \t\t}) \t); }); $(&quot;thead&quot;,mytable).append(TitleCell); \/\/\u0414\u0430\u043d\u043d\u044b\u0435 $.each(TableValue,function() { \t\/\/\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \tvar DataCell = $('&lt;tr\/&gt;'); \t\/\/\u041f\u0440\u043e\u0431\u0435\u0433\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u044f\u0447\u0435\u0439\u043a\u0430\u043c \t$.each(this,function() { \t\tDataCell.append( \t\t\t$('&lt;td\/&gt;',{ \t\t\t\ttext:this \t\t\t}) \t\t); \t}); \t$(&quot;tbody&quot;,mytable).append(DataCell); });  \/\/\u0411\u0435\u0437 \u0446\u0438\u043a\u043b\u0430 (\u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e) $.each(TableValue,function( i, myData ) { \t$(&quot;tbody&quot;,mytable).append( \t\t$('&lt;tr\/&gt;').append( \t\t\t$('&lt;td\/&gt;',{text:this[0]}), \t\t\t$('&lt;td\/&gt;',{text:this[1]}), \t\t\t$('&lt;td\/&gt;',{text:myData[2]}), \/\/\u0418\u043b\u0438 \u0442\u0430\u043a \t\t\t$('&lt;td\/&gt;',{text:myData[3]}) \t\t) \t); });  $('.content').append(mytable); <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:  <\/p>\n<pre><code class=\"html\">&lt;table class=&quot;mytable&quot;&gt; \t&lt;thead&gt; \t\t&lt;tr&gt; \t\t\t&lt;th&gt;Site&lt;\/th&gt; \t\t\t&lt;th&gt;Google&lt;\/th&gt; \t\t\t&lt;th&gt;Yandex&lt;\/th&gt; \t\t\t&lt;th&gt;Bing&lt;\/th&gt; \t\t&lt;\/tr&gt; \t&lt;\/thead&gt; \t&lt;tfoot&gt;&lt;\/tfoot&gt; \t&lt;tbody&gt; \t\t&lt;tr&gt; \t\t\t&lt;td&gt;http:\/\/habr.ru\/&lt;\/td&gt; \t\t\t&lt;td&gt;4&lt;\/td&gt;&lt;td&gt;6&lt;\/td&gt; \t\t\t&lt;td&gt;26&lt;\/td&gt; \t\t&lt;\/tr&gt; \t\t&lt;tr&gt; \t\t\t&lt;td&gt;http:\/\/habrahabr.ru\/&lt;\/td&gt; \t\t\t&lt;td&gt;3&lt;\/td&gt; \t\t\t&lt;td&gt;1&lt;\/td&gt; \t\t\t&lt;td&gt;6&lt;\/td&gt; \t\t&lt;\/tr&gt; \t\t&lt;tr&gt; \t\t\t&lt;td&gt;http:\/\/google.ru\/&lt;\/td&gt; \t\t\t&lt;td&gt;1&lt;\/td&gt; \t\t\t&lt;td&gt;1&lt;\/td&gt; \t\t\t&lt;td&gt;1&lt;\/td&gt; \t\t&lt;\/tr&gt; \t&lt;\/tbody&gt; &lt;\/table&gt; <\/code><\/pre>\n<p><a href=\"http:\/\/jsfiddle.net\/bSVYE\/\">\u0414\u0435\u043c\u043e<\/a><\/p>\n<h3>\u0421\u043f\u0438\u0441\u043a\u0438<\/h3>\n<p>  <\/p>\n<pre><code class=\"javascript\">var lang = ['Russian', 'English', 'Ukraine']; var mylist = $('&lt;ul\/&gt;'); \/\/\u041d\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c $.each(lang, function() {     $('&lt;li\/&gt;',{text:this}).appendTo(mylist);     \/\/\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0441\u044b\u043b\u043a\u0443     $('&lt;li\/&gt;').wrapInner(     \t$(&quot;&lt;a\/&gt;&quot;,{     \t\t&quot;href&quot;:&quot;#&quot;,     \t\ttext:this     \t}))     .appendTo(mylist); }); $('.content').append(mylist); <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;ul&gt; \t&lt;li&gt;Russian&lt;\/li&gt; \t&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Russian&lt;\/a&gt;&lt;\/li&gt; \t&lt;li&gt;English&lt;\/li&gt; \t&lt;li&gt;&lt;a href=&quot;#&quot;&gt;English&lt;\/a&gt;&lt;\/li&gt; \t&lt;li&gt;Ukraine&lt;\/li&gt; \t&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Ukraine&lt;\/a&gt;&lt;\/li&gt; &lt;\/ul&gt; <\/code><\/pre>\n<p><a href=\"http:\/\/jsfiddle.net\/gtQgX\/\">\u0414\u0435\u043c\u043e<\/a><\/p>\n<h3>\u0421\u043a\u0440\u0438\u043f\u0442\u044b<\/h3>\n<p>  <\/p>\n<pre><code class=\"javascript\">$(&quot;&lt;script\/&gt;&quot;,{ \tsrc:'js\/inc.js' }).appendTo(&quot;body&quot;); <\/code><\/pre>\n<h3>\u0421\u0442\u0438\u043b\u0438<\/h3>\n<p>  <\/p>\n<pre><code class=\"javascript\">$(&quot;&lt;link\/&gt;&quot;,{ \thref:'css\/inc.css', \trel:'stylesheet' }).insertAfter(&quot;link:last&quot;); <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e <code>$('&lt;input\/&gt;')<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0431\u0435\u0437 \u043a\u043b\u044e\u0447\u0430 <code>$('&lt;input&gt;')<\/code>, \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<br \/>  \u0415\u0441\u043b\u0438 \u0443 \u043a\u043e\u0433\u043e-\u0442\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f\/\u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u0432\u044b\u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0432 \u041f\u041c \u0438\u043b\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. <\/p>\n<p>  \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u043d\u0430 <a href=\"https:\/\/github.com\/Vitaliti\/dynamic_jquery\">github<\/a> \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/166109\/\"> http:\/\/habrahabr.ru\/post\/166109\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0421\u043a\u0430\u0436\u0443 \u0441\u0440\u0430\u0437\u0443, \u0432\u0441\u044e DOM-\u043c\u043e\u0434\u0435\u043b\u044c \u043c\u044b \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u0430 \u043b\u0438\u0448\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438 \u043a\u0430\u043a \u0441 \u043d\u0438\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 jQuery. \u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0438\u043b\u0438 \u0442\u0435\u0445 \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u00ab\u043d\u0430 \u043b\u0435\u0442\u0443\u00bb, \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043a\u043e\u043c\u0443-\u0442\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e.<br \/>   \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438\u0437 js, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e ajax \u0438\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435. \u041d\u043e \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u0441 \u0432\u0430\u0448\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0418 \u0447\u0430\u0441\u0442\u043e \u0434\u0430\u0436\u0435 \u0432 \u043e\u0447\u0435\u043d\u044c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u043a\u043e\u0434 \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430:<\/p>\n<pre><code class=\"javascript\">var content = &quot;&lt;table&gt;&quot; for(i=0; i&lt;3; i++){     content += '&lt;tr&gt;&lt;td&gt;' + 'result ' +  i + '&lt;\/td&gt;&lt;\/tr&gt;'; } content += &quot;&lt;\/table&gt;&quot;  $('#table').append(content); <\/code><\/pre>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u043a\u043e\u0434\u0430 \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430 \u0431\u044b\u0441\u0442\u0440\u0443\u044e \u0440\u0443\u043a\u0443, \u044f \u0438 \u0441\u0430\u043c \u0442\u0430\u043a \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u0434\u0435\u043b\u0430\u043b, \u043d\u043e \u0432\u0435\u0434\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u043b\u0443\u0447\u0448\u0435.<br \/>   \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0432\u044b\u0432\u0435\u043b \u0441\u0430\u043c\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0432\u0430\u043c \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f.<br \/>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-166109","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/166109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=166109"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/166109\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=166109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=166109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=166109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}