Other than moving the attributes into the HTML markup as the comments suggest, you could improve the code:
var dictionary = {
'#callerfirst' : 'May I have your first name?',
'#callerlast' : 'May I have your last name?',
'select[name="carriername"]' : 'May I have your wireless provider?',
'select[name="csrcallerrelationship"]' : 'May I have your relationship to the account holder?'
...
...
};
$.each(dictionary, function(key, value){
$(key).attr('title', value);
});
The benefit of this is if you need to put the text elsewhere in the element other than the title attribute, it's one change instead of many. The attr()
repetition is removed.