---
id: 587d7fae367417b2b2512be6
title: Render Images from Data Sources
challengeType: 6
videoUrl: ''
localeTitle: 从数据源渲染图像
---
## Description
最后几个挑战表明,JSON数组中的每个对象都包含一个imageLink
键,其值为cat图像的URL。循环浏览这些对象时,可以使用此imageLink
属性在img
元素中显示此图像。这是执行此操作的代码: html += "<img src = '" + val.imageLink + "' " + "alt='" + val.altText + "'>";
## Instructions
添加代码以在img
标记中使用imageLink
和altText
属性。
## Tests
```yml
tests:
- text: 您应该使用imageLink
属性来显示图像。
testString: assert(code.match(/val\.imageLink/g));
```
## Challenge Seed
```html
Cat Photo Finder
The message will go here
```
## Solution
```js
// solution required
```
/section>