Can someone assist me with this task? My goal is to dynamically append a div when selecting an option from a dropdown, and hide the div when the same option is selected again. Additionally, I want the name of the selected option to be displayed on the left side next to the appended div. You can find a demonstration of my code sample on jsfiddle
Below is my HTML code snippet.
<div class="container">
// HTML code here
</div>
Here is my CSS code snippet. I have set the display property to none for certain elements to control their visibility based on selection status.
.select-input button {
background-color: #aa1876 !important;
color: #fff !important;
padding: 10px 20px;
}
#attribute_show {
display: none;
}
And here is the JQuery code snippet. It includes Bootstrap-select initialization and handling of select option events.
//JQuery code here
I would greatly appreciate any help with this issue. If you need more clarity on my code, please refer to this link https://jsfiddle.net/innodigita/9Lcq40su/60/