gpt4 book ai didi

javascript - 引用生成器网站不能在显示内容之间放置符号或空格

转载 作者:行者123 更新时间:2023-11-28 06:45:35 27 4
gpt4 key购买 nike

我正在设计一个引用生成器网站,我直接在页面上打印文本框值,但我无法在 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com