So I have an anchor which looks like
<a href="http://something.com/something/" class="dropdown-toggle">something</a>
and I want to add
data-toggle="dropdown"
so that it ends up looking like
<a href="http://something.com/something/" class="dropdown-toggle" data-toggle="dropdown">something</a>
I tried
$(".dropdown-toggle").data("toggle", "dropdown");
But it isnt adding anything
cheers
You can use attr() jquery method to add the attribute.
Live Demo