亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用對象將setAttribute轉換為img

使用對象將setAttribute轉換為img

肥皂起泡泡 2021-04-09 10:14:13
Java的新手。這是一個類似程序的抽認卡,應該包含圖像,然后您猜出它的名稱。我正在使用setAttribute,但是圖像沒有填充頁面。我應該為它選擇一個圖像進行for循環還是只是做我所做的事情?我需要使用setAttribute,但我仍然堅持為什么圖像不會填充。非常感謝您的幫助。function populateImages() {  var newDiv = document.createElement('div');  newDiv.setAttribute('class', 'frame');  newDiv.setAttribute('src', personArray.url);  newDiv.setAttribute('onclick', 'promptForName(this)');  newDiv.setAttribute('onmouseover', 'styleIt(this)');  newDiv.setAttribute('onmouseout', 'unStyleIt(this)');  newDiv.setAttribute('id', '1');  document.getElementById('pic-grid').appendChild(newDiv);}
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 187 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號