I want to create the following DOM structure using jQuery.
<li>
<label> user
<input type=radio>
</label>
</li>
Here is my jQuery.
$('<input>')
.attr({type:'radio'})
.appendTo($('<label>'))
.text('user')
.appendTo($('<li>'))
Some how it’s not working or there is something wrong, what would be best practice here?
your problem is this,
I think you have just missed the logic. Try this,
if you want to chain everything, then do it this way,