我希望某些变量的值显示在字符串中。
function test()
{
var first = document.getElementById('first').value; //value ==hello
var second = document.getElementById("second").value; //value == bye
var third = document.getElementById("third").value; //value == crazy
var forth = document.getElementById("forth").value; // value == night
var myString = " \
<script> \
var firstValue =first; \
var secondValue =second; \
var thirdValue =third; \
var forthValue =forth; \
<\/script> ";
我想要显示字符串:
<script> \
var firstValue ="hello"; \
var secondValue ="bye"; \
var thirdValue ="crazy"; \
var forthValue ="night"; \
<\/script> ";