Computer >> कंप्यूटर ट्यूटोरियल >  >> प्रोग्रामिंग >> JavaScript

JavaScript का उपयोग करके कन्फर्म बॉक्स में बटन लेबल कैसे बदलें?


कन्फर्म बॉक्स में बटन लेबल बदलने के लिए, निम्न कोड चलाकर देखें। कोड jQuery और CSS का उपयोग करके एक कन्फर्म बॉक्स बनाता है जिसमें मानक कन्फर्म बॉक्स से अलग बटन लेबल होता है -

उदाहरण

<!DOCTYPE html> <html>    <head>       <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">       </script>       <script>          function functionConfirm(msg, myYes, myNo)          {             var confirmBox = $("#confirm");             confirmBox.find(".message").text(msg);             confirmBox.find(".yes,.no").unbind().click(function()             {               confirmBox.hide();             });             confirmBox.find(".yes").click(myYes);             confirmBox.find(".no").click(myNo);             confirmBox.show();          }       </script>       <style>          #confirm          {             display: none;             background-color: #91FF00;             border: 1px solid #aaa;             position: fixed;             width: 250px;             left: 50%;             margin-left: -100px;             padding: 6px 8px 8px;             box-sizing: border-box;             text-align: center;          }          #confirm button {             background-color: #48E5DA;             display: inline-block;             border-radius: 5px;             border: 1px solid #aaa;             padding: 5px;             text-align: center;             width: 100px;             cursor: pointer;          }          #confirm .message          {             text-align: left;          }       </style>    </head>    <body>       <div id="confirm">          <div class="message"></div>          <button class="yes">Like!</button>          <button class="no">No, I Like Cricket!</button>          </div>       <button onclick = 'functionConfirm("Do you like Football?", function yes()       {          alert("Yes")       }, function no()       {          alert("no")       });'>submit</button>    </body> </html>

  1. JavaScript का उपयोग करके प्रिंट डायलॉग बॉक्स कैसे पॉप-अप करें? JavaScript का उपयोग करके प्रिंट डायलॉग बॉक्स कैसे पॉप-अप करें?

    print() मेथड JavaScript का उपयोग करके प्रिंट डायलॉग बॉक्स पॉप-अप करने के लिए, print() मेथड का उपयोग करें। डायलॉग बॉक्स के साथ, आप आसानी से प्रिंटिंग विकल्प सेट कर सकते हैं जैसे प्रिंटिंग के लिए कौन सा प्रिंटर चुनना है। प्रिंट डायलॉग बॉक्स उदाहरण <!DOCTYPE html> <html> <body>

  1. Swift का उपयोग करके बटन का बैकग्राउंड कलर कैसे बदलें? Swift का उपयोग करके बटन का बैकग्राउंड कलर कैसे बदलें?

    UIButton बैकग्राउंड कलर बदलना iOS एप्लिकेशन में बटन का बैकग्राउंड कलर बदलने के लिए हमें UIButton की backgroundColor प्रॉपर्टी को एक्सेस करने की आवश्यकता होती है। हम इसे दो तरीकों से कर सकते हैं: प्रोग्रामेटिकली और स्टोरीबोर्ड का उपयोग करके। विधि 1: स्टोरीबोर्ड एडिटर का उपयोग अपने स्टोरीबोर्ड पर एक

  1. बटन दबाने पर Tkinter लेबल टेक्स्ट कैसे बदलें? बटन दबाने पर Tkinter लेबल टेक्स्ट कैसे बदलें?

    अक्सर, Tkinter लेबल विजेट्स का उपयोग एप्लिकेशन में टेक्स्ट या इमेज डिस्प्ले करने के लिए किया जाता है। हम config(**options) मेथड का उपयोग करके लेबल विजेट को कॉन्फ़िगर कर सकते हैं जैसे इसकी टेक्स्ट प्रॉपर्टी, कलर, बैकग्राउंड या फोरग्राउंड कलर। यदि आपको लेबल विजेट को डायनामिकली संशोधित या बदलने की आवश