javascript - Onclick populate unique text into a textbox -
javascript - Onclick populate unique text into a textbox -
i using table info database, have link each row gets generated dynamically in table, if click on link bootstrap modal appear e.g.
$(document).on("click", ".edit", function (e) { $('.showthis').modal('show'); }); <div class="modal fade showthis"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">modal title</h4> </div> <div class="modal-body"> <textarea id="textarea"></textarea> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">close</button> <button type="button" class="btn btn-primary">save changes</button> </div> </div> </div>
in table getting individual id each row e.g:
row += '<td>' + data[mod].sometext+ '<id-flip="' + data[mod].id + '"></td>'; row += '<td><a href="#" class="edit" id= "' + data[mod].id + '"></td>';
question is: how info data[mod].sometext
, place id="textarea"
can tell me how?
i think want:
document.getelementbyid('textarea').innerhtml = data[mod].sometext;
and jquery:
$('#textarea').html(data[mod].sometext);
javascript jquery twitter-bootstrap
Comments
Post a Comment