I have a container with CSS that truncates text to show ellipsis when it reaches a certain width. Despite the truncation, the full text remains unchanged inside. To test this feature, I'd like to be able to access the truncated text with JavaScript. Is there a way to retrieve the truncated text marked with ellipsis using JavaScript?
@media (max-width: 1129px) {
#mydiv {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100px;
display: inline-block;
}
}