How to write PHP code inside javascript inner HTML, I want to write PHP code inside javascript innerHTML that contain HTML code
<?php
<script>
document.getElementById("view-img-path"+id).innerHTML ="<input type='hidden' name='new-image-attachment-id' id='image-attachment-id' value='"<?php echo get_option('media_selector_attachment_id'); ?>"'/>"
</script>
I want to write PHP code inside, is my code is correct it is showing error in my IDE