I would like to include a html select into a confluence page, and I would like to have different background color for each option. I do have the background color for each option, but when I select the option it does not keep the background color. Could someone please help?
Here is the html:
<script type="text/javascript">
AJS.$("#select").change(function(){
var color = $("option:selected", this).attr("class");
$("#select").attr("class", color); });
</script>
<select id="select" class="">
<option class="yellow">Waiting for test</option>
<option class="green">Passed</option>
<option class="red">Failed</option>
</select>
Here is the css:
.green {
background-color: green;
}
.yellow {
background-color: yellow;
}
.red {
background-color: red;
}
Want to leave your mark on Confluence? One winner will have their whiteboard design added into Confluence for all users to access! This is your chance to showcase your creativity, help others, and gain recognition in the Confluence community.
Share your template today!Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.