is there elegant way of updating 'description' using jquery?
<div> <div class="radio"> <label> <input name="somename" type="radio">description </label> </div> <div class="well"> <div class="line">something</div> <div class="line">something else</div> </div> </div> i had tried text('new description') on label input removed well. there solution without having serialized html in javascript?
what i'm trying achieve have template radio button in source html can clone, update , append dynamically. i'm not sure if there better pattern out there achieve dynamic list of choices.
here are: use label for
$('#somelabel').text('new description'); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div> <div class="radio"> <input name="somename" type="radio"> <label id='somelabel' for="somename">description</label> </div> <div class="well"> <div class="line">something</div> <div class="line">something else</div> </div> </div> hope helps.
Comments
Post a Comment