Which code should I use so that I can create a dropdown list using Javascript or Jquery just like where I have to create a dropdown list for country and state and cities? Here is my code.
<!DOCTYPE html>
<html>
<head>
<title>BLAST FURNACE</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<style>
.spad{
padding: 80px;
}
#my_image{
width: 100%;
height: auto;
}
.cont{
width: 700px;
height: 700px;
border: 1px solid #000;
}
</style>
</head>
<body>
<h1>BLAST FURNACE SIMULATION</h1>
<p>BLAST FURNACE SIMULATION PROCESS.</p>
<!-- <canvas id="myCanvas" width="500" height="500" style="border:1px solid #000000;">
<span class="spanloader">
</span>
</canvas> -->
<!-- <button type="button"
onclick="document.getElementById('demo').innerHTML = Date()">
CLICK HERE TO CHARGE IRON ORE FLUX INTO BLAST FURNACE.</button> -->
<!-- <input type="button" id="btnnext" value="CLICK HERE TO CHARGE IRON ORE FLUX INTO BLAST FURNACE" /> -->
<!-- <script>
var img=document.createElement("img");
img.src
</script> -->
<div class="cont">
<div class="row spad">
<img id="my_image" src="#" class="img-fluid"/>
</div>
<span class="spanloader">
<span>set Loading Image Image</span>
</span>
</div>
<input type="button" id="btn01" value="CLICK HERE TO SHOW EMPTY BLAST FURNACE " />
<input type="button" id="btn02" value="CLICK HERE TO CHARGE IRON ORE FLUX INTO BLAST FURNACE" />
<input type="button" id="btn03" value="CLICK HERE TO SHOW BLAST FURNACE" />
</body>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js"></script>
<!-- Popper JS -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript">
$('#btn01').click(function () {
$("#my_image").attr("src", "empty.png");
});
$('#btn02').click(function () {
$("#my_image").attr("src","Sequence01_1.gif");
});
$('#btn03').click(function () {
$("#my_image").attr("src", "BLASTFURNACE.png");
});
</script>
</html>
Here I want to create a dropdown list to select from country and after selecting country another dropdown list of cities should appear.
<select>tag with a list of countries? That part is basic HTML.selectoptions. While you might need JavaScript to retrieve and handle the data, the basic markup is all HTML as @kmoser notedselectandoptionsHTML elements to render them.