经典指数          
原因
1811
浏览数
0
收藏数
 

下面的 JSX 代码中,哪一个无法达到预期的效果?

  • <h2>Hello World</h2>
  • <input type=”checkbox”/>
  • <div class=”msg-box”>{msg}</div>
  • <label htmlFor=”name”>Leo</label>
  • <div style={{height: 50}}></div>
  • <img src={imgSrc}/>

     举报   纠错  
 
切换
1 个答案
选c class是js关键字,这里要用className。对于E选项,在jsx中直接写行内样式时不能采用引号,而是style={{color:'red'}}的方式。
 
切换
撰写答案
扫描后移动端查看本题