第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

如何使用 Javascript 設置默認選項?

如何使用 Javascript 設置默認選項?

qq_笑_17 2021-06-21 09:19:39
我正在嘗試為游戲市場構(gòu)建貨幣轉(zhuǎn)換器,我目前擁有它,以便在輸入欄中顯示每種貨幣/付款方式的相應圖標 - 它具有付款選項的默認選項,但跨度為空白直到用戶點擊一個國家。如何設置默認值以便圖標 100% 出現(xiàn)?我設法使其與付款方式圖標一起使用,但我缺少國家/地區(qū)圖標的某些內(nèi)容https://codepen.io/anon/pen/byXrWN    const data = [    {        currency: 'paypal',        we_buy: 0.50,        we_sell: 0.68,        img_path: 'img/paypal.svg',        icon: 'fab fa-paypal'    },    {        currency: 'debit',        we_buy: 0.67,        we_sell: 0.82,        img_path: 'img/debit-card.svg',        icon: 'far fa-credit-card'    },    {        currency: 'btc',        we_buy: 0.58,        we_sell: 0.77,        img_path: 'img/bitcoin.svg',        icon: 'fab fa-btc'    },    {        currency: 'ethereum',        we_buy: 0.59,        we_sell: 0.76,        img_path: 'img/ethereum.svg',        icon: 'fab fa-ethereum'    }];const country = [    {        country_id: 'USA',        country_currency: 'USD',        img_path: 'img/united-states.svg',        icon: 'fas fa-dollar-sign',        rate: 1.0    },    {        country_id: 'EUR',        country_currency: 'EUR',        img_path: 'img/european-union.svg',        icon: 'fas fa-euro-sign',        rate: 0.88    },    {        country_id: 'UK',        country_currency: 'GBP',        img_path: 'img/united-kingdom.svg',        icon: 'fas fa-pound-sign',        rate: 0.78    },      {        country_id: 'CAN',        country_currency: 'CAD',        img_path: 'img/canada.svg',        icon: 'fas fa-dollar-sign',        rate: 1.33    }];const countryContainer = document.getElementById("countries");let selectedCountry = null;var selectCountry = function (index) {    const cdata = country[index];    selectedCountry = country[index];    document.getElementById("country-selected").innerHTML = `Country selected: ${cdata.country_currency}`;    document.getElementById("country_icon").className = cdata.icon;};頂行是國家選擇,底行是付款方式(在 html/js 中命名不當 - 貨幣 = 付款方式)付款方式的圖標應在頁面加載時出現(xiàn),而不是在用戶單擊其原籍國之后
查看完整描述

1 回答

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

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號