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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

嘗試使用 Javascript 輸出到文本框

嘗試使用 Javascript 輸出到文本框

蕪湖不蕪 2021-11-12 17:46:06
我正在創(chuàng)建一個(gè)通信生成器,它將標(biāo)準(zhǔn)化關(guān)于我公司的關(guān)鍵 IT 事件的 SMS 通信。我有一個(gè) IF/ELSE 語(yǔ)句,用于確定問(wèn)題是新的、更新的還是已解決的,以便將必要的信息匯總在一起并相應(yīng)地對(duì)其進(jìn)行格式化。據(jù)我所知,這里的一切都很好,但是我在寫入文本框('smsToSend')時(shí)遇到了問(wèn)題,應(yīng)該允許用戶在將文本復(fù)制到我們的短信發(fā)送器應(yīng)用程序之前進(jìn)行查看,因?yàn)闆](méi)有正在輸出到此框中。function generateSMS(){ var issueTitle = document.getElementById("incidentTitle"); var advisorImpact = document.getElementById("advisorImpact"; var incidentUpdate = document.getElementById("incidentUpdate"); var incidentStatus = document.getElementById("incidentState"); var startTime = document.getElementById("startTime"); var endTime = document.getElementById("endTime"); var incidentPriority = document.getElementById("incidentPriority"); var incidentBrand = "TechTeam"; var systemImpacted = document.getElementById("systemImpacted"); var incidentReference = document.getElementById("incidentReference"); var smsToSend = document.getElementById("smsToSend"); if (incidentStatus != "Closed"){     smsToSend = "P" + incidentPriority + " " + incidentBrand + "IT RESOLVED: " + systemImpacted + ": " + incidentUpdate + ": Start: " + startTime + " End: " + endTime + " Reference: " + incidentReference;}else{     if (incidentUpdate == "We are investigating this issue"){         smsToSend = "P" + incidentPriority + " " + incidentBrand + "IT ISSUE: " + systemImpacted + ": " + issueTitle + ". " + advisorImpact + ": " + incidentReference;     }     else {         smsToSend = "P" + incidentPriority + " " + incidentBrand + "IT UPDATE: " + systemImpacted + ": " + incidentUpdate + ": " + incidentReference;     } }}generateSMS();alert.getElementById(smsToSend);
查看完整描述

2 回答

?
守候你守候我

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超10個(gè)贊

嘗試將所有分配替換為smsToSend這樣:

smsToSend = yourValue;

有了這個(gè):

smsToSend.value = yourValue;

您的問(wèn)題發(fā)生是因?yàn)?code>smsToSend是元素的實(shí)例,而不是鏈接到顯示文本的變量。要更新元素的值,您必須更改value元素的屬性。


查看完整回答
反對(duì) 回復(fù) 2021-11-12
?
肥皂起泡泡

TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超6個(gè)贊

將值設(shè)置為文本框的正確方法是


var smsToSend = document.getElementById("smsToSend");


smsToSend.value = "Your value";


查看完整回答
反對(duì) 回復(fù) 2021-11-12
  • 2 回答
  • 0 關(guān)注
  • 272 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)