I discovered that Auto-Suggestions on Single Line Fields have a CSS class of .ellipsis.
I want to bold the first part of each Auto-Suggestion up to the double dash in this example. The Auto-Suggestions are generated by a Lookup Rule.
The console.logs() in the script below return correct values, but the first part of the string is still not changing to bold. I'm missing something, but I don't know what.
I would appreciate any help you can offer...thank you!
$(document).ready(function() { $('#q110 input').focus(function() { console.log('focused'); $('.ellipsis').each(function() { let text = $(this).text(); console.log(text); let dashIndex = text.indexOf('-'); console.log(dashIndex); if (dashIndex != -1) { let firstPart = text.substring(0, dashIndex); console.log(firstPart); let restPart = text.substring(dashIndex); console.log(restPart); $(this).html('<strong>' + firstPart + '</strong>' + restPart); } }); }); });