Olga1108 4 năm trước cách đây
mục cha
commit
e8d8bdef3c
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      js11/index.js

+ 3 - 1
js11/index.js

@@ -18,7 +18,9 @@ req.open('GET', 'one.json', true);
 req.onload  = function() {
   var jsonResponse = req.response;
   jsonResponse.forEach(element => {
-    document.body.appendChild(document.createElement('img')).src = element.ref;
+   let img = document.body.appendChild(document.createElement('img'));
+   img.style.width = 600;
+   img.src = element.ref;
     //element.style.width = 600;
     document.body.appendChild(document.createElement('p')).innerText = element.title;
   });