I'm using PHP to retrieve data from my database and then leveraging Javascript to enable users to add it. However, I am facing challenges in making a div change its background color and apply borders.
<div class="displayedItems"></div>
<script type="text/javascript">
$('#addButton').on('click', function( event ) {
$('.displayedItems').append($('#search_term').val() + '<br>');
});
</script>
<style type="text/css">
.displayedItems{
background-color: yellow;
margin-top: 50px;
}
</style>
Your assistance on this issue would be highly appreciated.