1

I have a script (javascript)

<script>
$(function(){
    $(".editagunan").click(function(){
        var id_agunan = $(this).attr("data_id_agunan"); 

        $("#value_id_agunan").val(id_agunan);

        $("#myModalEdit").modal("show");
    });
});
</script>

how to display 'value_id_agunan' from javascript to php

<?php echo id="value_id_agunan" ?>

but the script is wrong, how to fix ? Thanks

Kode Rumit
  • 19
  • 7
  • Give a look at: http://stackoverflow.com/questions/3072817/data-transfer-from-javascript-to-php – al27091 Feb 05 '17 at 15:31
  • Possible duplicate of [Data transfer from JavaScript to PHP](http://stackoverflow.com/questions/3072817/data-transfer-from-javascript-to-php) – Faegy Feb 05 '17 at 18:27

1 Answers1

0

Assuming, you are asking on how to write html inside a php file.

Just write HTML directly, like this:

<p id="value_id_agunan"></p> 

If you want to show the above html code on some condition then use php like this:

<?php if(showParagraph){ /* some variable */ ?>
    <p id="value_id_agunan"></p>
<?php } ?> 
Mr_Green
  • 40,727
  • 45
  • 159
  • 271