Pass ID of radio-input to the attached label

I'm using the following view to create an input of radio type:

Ember.RadioButton = Ember.View.extend({  
    tagName : "input",
    type : "radio",
    attributeBindings : [ "name", "type", "value", "checked:checked:" ],
    click : function() {
        this.set("selection", this.$().val())
    },
    checked : function() {
        return this.get("value") == this.get("selection");   
    }.property()
});

It creates the following HTML:

<input type="radio" value="2.5" name="selectionTest" class="ember-view" id="ember293">

I'd like to have a label element below each radio-button with the for attribute set to the radio-button's ID. All this to be able to style the radio-button.

How would I go about accomplishing this?

Answers


Need Your Help

Convert PHP Multi-Dimensional Array to Postgres HStore

php arrays postgresql multidimensional-array hstore

Has anyone come up with a good solution for converting an array to a Postgres HStore Values?

Disallow item addition in a List or Doc lib

sharepoint permissions

How can I disallow adding item or document to a list or document library? Due to some other feature scenario I cannot break role inheritance and have custom permission set for the list. Today, we

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.