After the foreach number is changed, how can I import the value if I choose to be editable in the same account?

<?foreach ($region_get_all->regions as $key):?>
    // 
<?endforeach;?>

suppose I get multiple numbers via foreach
what I want to do is that when the user selects the "edit" data
, I will show the div
that there will be data

, and will automatically enter it into the account

.
// foreach
<button
 data-id="<id>"
 type="button" class="openRightLayout"></button>

// js
$(".openRightLayout").click(function(e) {
  e.preventDefault();
    var id = e.currentTarget.dataset.id;
  $("-sharpservice_range").val(id);
});

// divinput:service_range
<div>
<input id="service_range" name="service_range" type="text" value="">
</div>

he can"t do it like this. He didn"t really put the value into input.

.

Are all the elements in

foreach rendered dynamically? So button didn't exist in the first place?
then your code:

$(".openRightLayout").click(function(e) {
  e.preventDefault();
    var id = e.currentTarget.dataset.id;
  $("-sharpservice_range").val(id);
});

in fact, there is no guarantee that the event is successful, is it? What about the trial event commission?

$('body').on('click','.openRightLayout',function(){})
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b30e5a-2bd41.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b30e5a-2bd41.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?