我正在设计一个引用生成器网站,我直接在页面上打印文本框值,但我无法在 2 个文本框显示值之间集成空格或符号 请告诉我如何在显示的内容之间添加符号或空格
这是我的代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<html>
<head>
</head>
<body>
<script type="text/javascript">
function changeThis(){
var formInput = document.getElementById('theInput').value;
document.getElementById('newText').innerHTML = formInput;
var formInput = document.getElementById('theInput2').value;
document.getElementById('newText2').innerHTML = formInput;
}
</script>
<input type='text' id='theInput' value='' />
<input type='text' id='theInput2' value='' />
<input type='button' onclick='changeThis()' value='generate'/>
<br>RESULT <span id='newText'></span><span id='newText2'></span> </p>
</body>
</html>
</body>
</html>
最佳答案
只需使用十六进制实体
fiddle - http://jsfiddle.net/1278p7c5/
关于javascript - 引用生成器网站不能在显示内容之间放置符号或空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34066913/