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

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

閱讀更多按鈕以顯示成功付款消息的彈出窗口

閱讀更多按鈕以顯示成功付款消息的彈出窗口

偶然的你 2022-11-11 13:47:42
我正在創(chuàng)建一個(gè)閱讀更多按鈕,但我的意圖是當(dāng)它被點(diǎn)擊時(shí),它應(yīng)該顯示一條彈出消息,說明已成功付款,然后顯示該段落的其余部分。這是我的代碼function myFunction() {  var dots = document.getElementById("dots");  var moreText = document.getElementById("more");  var btnText = document.getElementById("myBtn");  if (dots.style.display === "none") {    dots.style.display = "inline";    btnText.innerHTML = "Read more";    moreText.style.display = "none";  } else {    dots.style.display = "none";    btnText.innerHTML = "Read less";    moreText.style.display = "inline";  }}<!DOCTYPE html><html><head>  <meta name="viewport" content="width=device-width, initial-scale=1">  <style>    #more {      display: none;    }  </style></head><body>  <h2>Read More Read Less Button</h2>  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas vitae scel<span id="dots">...</span><span id="more">erisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta.</span></p>  <button onclick="myFunction()" id="myBtn">Read more</button></body></html>在這里,閱讀更多按鈕效果很好,但我希望它在顯示其余文本之前顯示一條彈出消息,說明已收到成功付款。請(qǐng)協(xié)助
查看完整描述

1 回答

?
肥皂起泡泡

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

只需添加警報(bào)


<!DOCTYPE html>

<html>

<head>

<meta name="viewport" content="width=device-width, initial-scale=1">

<style>

#more {display: none;}

</style>

</head>

<body>


<h2>Read More Read Less Button</h2>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas vitae scel<span id="dots">...</span><span id="more">erisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta.</span></p>

<button onclick="myFunction()" id="myBtn">Read more</button>


<script>

function myFunction() {


  alert("successful payment received ");


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

  var moreText = document.getElementById("more");

  var btnText = document.getElementById("myBtn");


  if (dots.style.display === "none") {

    dots.style.display = "inline";

    btnText.innerHTML = "Read more"; 

    moreText.style.display = "none";

  } else {

    dots.style.display = "none";

    btnText.innerHTML = "Read less"; 

    moreText.style.display = "inline";

  }

}

</script>


</body>

</html>


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

添加回答

舉報(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)