If you what to add bootstrap attributes in anchor tag dynamically than this will helps you lot
$(".dropdown a").attr({
class: "dropdown-toggle",
'data-toggle': "dropdown",
role: "button",
'aria-haspopup': "true",
'aria-expanded': "true"
});