Home>
I want to display a modal using bootstrap for web page creation, but when I click the corresponding button, the entire screen is grayed out, but the essential pop-up is not displayed.
I think this is the reason why the pop-up is not displayed properly because JQuery put in JavaScript is an error, but does anyone know the solution?
Or I wrote a script tag in the HTML head and specified that jQuery is used, but is this part wrong?
Below is the login form using the HTML modal.
<!-Navigation list->
<ul>
<li>About us</li>
<li>Promotion</li>
<li>Contact Us</li>
<li>Room List</li>
</ul>
<button type = "button">Login</button>
<button type = "button">Sign Up</button>
</nav>
<! --- SIGN UP AND LOG IN ------------------------------>
<! --------------- START LOGIN FORM -------------------->
<!-Modal->
<!-Modal content->
<button type = "button" data-dismiss = "modal">×</button>
<span></span>Login
<form role = "form">
<label for = "usrname"><span></span>Username</label>
<input type = "text" placeholder = "Enter email">
<label for = "psw"><span></span>Password</label>
<input type = "text" placeholder = "Enter password">
<label><input type = "checkbox" value = "" checked>Remember me</label>
<button type = "submit"><span></span>Login</button>
</form>
<button type = "submit" data-dismiss = "modal"><span></span>Cancel</button>
<p>Not a member? Sign Up</p>
<p>Forgot Password?</p>
I think there is something wrong with any (or all) of the above three, but I would appreciate it if you could tell me.
-
Answer # 1
-
Answer # 2
Use jQuery below
$('# login_myBtn'). on ('click', function () {
$('#myModal'). modal ('show');
});Remove and in HTML
Related articles
- javascript - question about the case of new promise () with await/async of js
- this is a rudimentary question about the for statement in javascript es 6
- javascript - i have a question about xmlhttprequest
- javascript - about replacing the question mark of gas
- javascript - about switching the display between desplay: none;and desplay: block;
- javascript - about the processing order of if statements
- javascript - about implementation of orbitcontrols in threejs and display of model
- about javascript split assignment
- c # - i have a question about qr code (qrcodeencoder class)
- about the message javascript error:'alert' is not defined
- python 3x - i have a question about pipenv i want to set the directory location
- windows - question about extracting event logs using wevtutil
- javascript - after installing bootstrap, the tag got an unintended js decoration
- javascript - about sending and receiving multiple forms using flask + websocket
- creating a simple quiz app about javascript
- javascript - about initialization of app in expressjs (library code)
- php - about compiling javascript code in laravel development
- i have a question about runtime errors and exception handling in python
- i have a question about the uwsc deletefile function
Related questions
- javascript - i can't scroll the hamburger menu on my smartphone
- java - the hamburger menu cannot be displayed properly
- javascript - i want to dynamically change the ogp (thumbnail image) of twitter
- javascript - i want to add the current display function of the current page
- javascript - when overlaying transparent images, i want to cover both the horizontal and vertical positions perfectly
- javascript - how to get multiple jquiry radio button values
- javascript - input screen like unlocking line
- javascript - i want to implement jquery accordion with fadeinout, but it looks like show, hide
- javascript - i want to be able to put only one draggable element in the droppable area
- javascript - [html/css] the inverted triangle mark in the select box is overwritten on the background
I think it means "deprecated" rather than an error.
.click is also rather
.on ('click',…)
I think the format of is better.If you want to open modally, do you need an option for the argument?
Bootstrap4 --Modal # Methods
$('# targetId'). modal ('show')
If it is a fixed timing such as "button click" instead of "I want to generate it at any timing", use that button
data-toggle = "modal" data-target = "# targetId"
I think it's easier to guess.