dpw70180
2017-06-24 10:11
浏览 47
已采纳

如何在javascript内部HTML中编写php代码

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

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

3条回答 默认 最新

相关推荐 更多相似问题