I don't know how to add name from my input into label attr for and same input as ID. They are in same div. Do you guys know how to do it ? Thank you.
Jquery:
$('input[type="text"]').each(function () {
var name = $("input").attr("name");
})
HTML:
<div data-role="fieldcontain">
<label>Name:</label>
<input type="text" name="fname" value="" />
</div>