echo使用document.write()通过class =“”传递变量

May I ask, why is it that this is not echoing any data? <input> receives a value of AAA-123-0001 by passing value in class="" (this is a modal:edit)

This line alone <input type="text" class="decid" id="decid" name="decid"> is working and displays the data that is being passed into the input box, but when I try to echo it, it wont.

<input type="text" class="decid" id="decid" name="decid">
<script type="text/javascript">
var abc = document.getElementById("decid").value;
<?php $abc = "<script>document.write(abc)</script>"?>   
</script>
<?php echo $abc;?>

But, when I supply it with data directly via var, it echoes.

<script type="text/javascript">
var abc = "echo value";
<?php $abc = "<script>document.write(abc)</script>"?>   
</script>
<?php echo $abc;?>

Also, when I try to feed the input box with data straight from value="", it works.

<input type="text" class="feed" id="`feed" name="feed" value="feed">
<script type="text/javascript">
var abc = document.getElementById("feed").value;
<?php $abc = "<script>document.write(abc)</script>"?>   
</script>
<?php echo $abc;?>

The data is being passed through javascript

$(function(){
  $("body").on('click', '.edit', function (e){
    e.preventDefault();
    $('#edit').modal('show');
    var id = $(this).data('id');
    getRow(id);
  });

May I ask for a solution on this concern?