Reputation: 759
Is there any standard approach to add tooltip for each radiobutton in buttonset?
<span id="tools">
<input type="radio" id="feature1" name="tool" title="feature 1"><label for="feature1">Tool 1</label>
<input type="radio" id="feature2" name="tool" title="feature 2"><label for="feature2">Tool 2</label>
</span>
and script:
$('#tools').buttonset();
I've already added title for each input but there are no any tooltips.
Upvotes: 2
Views: 765
Reputation:
You could use something like this
$(function() {
$('label').each(function() {
var radio = $(this).prop('for');
$(this).prop('title',$('#' + radio).prop('title'));
});
});
All that it relies on is jQuery and the for attribute for each label is correct.
Upvotes: 5