PHP TP框架模板赋值写在js里面出错问题

赋值到一个input里面,直接本页取值 没问题的

 <input type="hidden" value="{$data.main}" id="temp">

  <script type="text/plain" style="display: none" id="md_source">
   
  </script>
  <script>
     document.getElementById('md_source').innerHTML = document.getElementById('temp').value;
  </script>
 
原文地址:https://www.cnblogs.com/79524795-Tian/p/14735035.html