<div class="search_area">
<form action="/macd/key.php?" method="get" target="_blank">
<div class="s_ipt">
<input maxlength="64" type="text" name="" value="" />
</div>
<button type="submit" class="s_btn">搜索</button>
</form>
</div>
以上代码运行成html,比如我输入123,然后按搜索,地址会跳转到/macd/key.php?=123
有什么办法可以修改成我输入123,按搜索,地址跳转到/macd/key.php?123
------解决方案--------------------
这样可以
<form action="/macd/key.php" method="post" target="_blank" onsubmit="return myfunc(this)">
<div class="s_ipt">
<input maxlength="64" type="text" name="" value="123" />
</div>
<button type="submit" class="s_btn">搜索</button>
</form>
<script>
function myfunc(f) {
f.action = f.action + '?' + f.elements[0].value;
f.submit();
return false;
}
</script>