I work on asp.net razor page i face issue i can't add title for div class container and title must be with top border
exactly as field set and legend
so how to apply title to be part from top border using html and css and jquery
CSS
Classes
.scrollable-list {
overflow-y: auto;
max-height: 200px;
width: 180px;
}and to fill div class container and classlist with data i use jquery below
JavaScript
$('#btnDisplay').click(function (event) {
event.preventDefault();
$('#classesContainer').attr('title', 'Classes');
var dropdown = $('#accountclassname-select');
dropdown.empty();
$.ajax({
url: '?handler=AccountClassName',
type: "GET",
dataType: "json",
success: function (response) {
$('#classesContainer').show();
$('#classesList').html(''); // Clear existing classes
$('#classesList').append(' All
');
$.each(response, function (i, classes) {
var checkbox = $('');
var span = $('' + classes.classAccountName + '');
var listItem = $('
').append(checkbox, span);
$('#classesList').append(listItem);
});
}
});
});so how to assign title for div classcontainer ?

Jignesh KumarRank #91 · 22.9K reputationPosted Feb 27, 2024, 10:55 PM EST
Hello Ahmad salah,
Please use
. If you wish to set it dynamic then take one span for(Title of the container) and assing from Jquery.Title of the container Classes .scrollable-list { overflow-y: auto; max-height: 200px; width: 180px; }