How to make a simple modal pop up form using jquery and html

0 votes

I already read the tutorials on jquery but I'm having a hard time understanding it is there someone who can teach me more easier, please I want to happen is that when I press one of my buttons its value will display in #valueFromMyButton and when the modal pop out i can type a text and after i click ok the text that I type will be placed on #valueFromMyModal

<!DOCTYPE HTML>
    <html lang="en">
    <head>
        <meta charset="utf-8">
    </head>
    <body>
        <input id="btn1" type="button" value="1">
        <input id="btn2" type="button" value="2">
        <input id="btn3"type="button" value="3">

        <input id="valueFromMyModal" type="text">

        <!--How to make this pop up modal form-->
        <div id="myform">
            <form>
<label id="valueFromMyButton"></label>
            <input id="name" type="text">
            <input id="btnOK" type="button" value="Ok">
            </form>
        </div>
</body>
</html>

Jun 2 in JQuery by Edureka
• 13,600 points
20 views

1 answer to this question.

0 votes

Create A Modal

  1. <button onclick="document.getElementById('id01').style.display='block'" class="w3-button">Open Modal</button> ...
  2. <div id="id01" class="w3-modal">
  3. <div class="w3-modal-content">
  4. <div class="w3-container">
  5. <span onclick="document.getElementById('id01').style.display='none'
    <!-- Trigger/Open the Modal -->
    <button onclick="document.getElementById('id01').style.display='block'"
    class="w3-button">Open Modal</button>
    
    <!-- The Modal -->
    <div id="id01" class="w3-modal">
      <div class="w3-modal-content">
        <div class="w3-container">
          <span onclick="document.getElementById('id01').style.display='none'"
          class="w3-button w3-display-topright">&times;</span>
          <p>Some text in the Modal..</p>
          <p>Some text in the Modal..</p>
        </div>
      </div>
    </div>
    
    
    
answered Jun 2 by Edureka
• 13,600 points

Related Questions In JQuery

0 votes
0 answers

How to open a Bootstrap 4 modal dialog using jQuery

How is a Bootstrap 4 modal dialog ...READ MORE

Jun 7 in JQuery by Edureka
• 13,600 points
15 views
0 votes
1 answer
0 votes
1 answer

How to reset a form using jQuery with .reset() method

<input type="reset"> Syntax for reset(): formObject.reset() Syntax to convert ...READ MORE

answered Jun 16 in JQuery by rajatha
• 3,540 points
11 views
0 votes
1 answer

How to generate a simple popup using jQuery

To create a popup, add the data-role="popup" ...READ MORE

answered Jun 17 in JQuery by rajatha
• 3,540 points
13 views
0 votes
1 answer

What is jQuery?

Hey, jQuery is a fast and concise JavaScript ...READ MORE

answered Feb 14, 2020 in JQuery by kartik
• 37,510 points
293 views
0 votes
1 answer

Error: Global Variable is not accessable to local function

Hey kartik, A variable declared outside a function has a ...READ MORE

answered Feb 19, 2020 in PHP by Niroj
• 82,720 points
263 views
0 votes
1 answer

Uncaught TypeError: Cannot read property 'msie' of undefined - jQuery tools

Hello, Use the following script tag in your ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,720 points
8,247 views
0 votes
1 answer

Uncaught Error: Bootstrap's JavaScript requires jQuery

Hello @kartik, You have provided wrong order for ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,720 points
15,102 views
0 votes
1 answer

How to disable all <input > inside a form with jQuery?

To disable all form elements inside 'target', ...READ MORE

answered Jun 3 in JQuery by Edureka
• 13,600 points
7 views
0 votes
1 answer

How to trigger a click on a link using jQuery

If you are trying to trigger an ...READ MORE

answered Jun 3 in JQuery by Edureka
• 13,600 points
26 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP