例如,我知道可以在Javascript中执行某些操作,允许用户根据用户文本输入更新文本:
<script type="text/javascript">
function changeText2(){
var userInput = document.getElementById('userInput').value;
document.getElementById('boldStuff2').innerHTML = userInput;
}
</script>
<p>Welcome to the site <b id='boldStuff2'>dude</b> </p>
<input type='text' id='userInput' value='Enter Text Here' />
<input type='button' onclick='changeText2()' value='Change Text'/>
Run Code Online (Sandbox Code Playgroud)
查看上面的代码:tizag.com/javascriptT/javascript-innerHTML.php
但是,我想知道是否可以为url链接执行类似操作,而不是上面的代码.下面我逐步介绍了用户输入文本时我想要发生的事情:
原始链接:http://www.google.com/search? q =
文本字段中的用户输入:espn
用户单击按钮以在文本字段中提交文本
最终链接:http://www.google.com/search? q = espn
谢谢你的帮助......顺便说一句......如果你不能说我有点新手,那么细节是值得赞赏的.