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

2

1 Answer 1

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 } ?> 
Sign up to request clarification or add additional context in comments.

1 Comment

does not working, but it can work if using form <input type="text" class="form-control" name="id_agunan" id="value_id_agunan" >

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.