-1
I want to display a sequence of Forms with the jquery show and Hide on a site stylized with bootstrap the code used was that and n appear to have errors, because it works for half a second and back to q tava
$("#button-gender").click(function() {
$("#boy-or-girl").hide();
$("#food").show();
})
The code refers to that page:
<html>
<head>
<meta charset="UTF-8">
<link rel="s
tylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link rel="stylesheet" href="styles/main.css">
<link rel="stylesheet" href="styles/quiz.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@100;200;300;400;500;531;600;700;800;900&display=swap" rel="stylesheet">
</head>
<body>
<div class="container first-content" id="boy-or-girl">
<form action="">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="boy" id="boy" value="M">
<label class="form-check-label" for="boy">Menino</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="girl" id="girl" value="F">
<label class="form-check-label" for="girl">Menina</label>
</div>
<div class="form-group row">
<div class="col-sm-10">
<button type="submit" class="btn btn-primary" id="button-gender">Próximo</button>
</div>
</div>
</form>
</div>
<div class="container" id="food" style="display: none;">
<div class="jumbotron jumbotron-fluid mt-3 rounded-pill">
<div class="container">
<h1 class="display-4">Escolha sua comida</h1>
<p class="lead"></p>
</div>
</div>
<form class="mb-2" method="POST" action="registra.php">
<div class="form-check mb-2">
<input class="form-check-input" type="checkbox" value="" name="biscoito" id="defaultCheck1">
<label class="form-check-label" for="defaultCheck1">
Biscoitos
</label>
</div>
<div class="form-check mb-2">
<input class="form-check-input" type="checkbox" value="" name="" id="defaultCheck1">
<label class="form-check-label" for="defaultCheck1">
Salgadinhos
</label>
</div>
</form>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
<script src="quiz.js"></script>
</body>
</html>
I would like to know why the div q dei . Hide() comes back immediately and how to make it stop, if you see this happening help< I recorded in this drive.