2017-07-27 93 views

回答

0

處理這種情況的最佳方法是使用Javascript或jQuery,它是javascript的庫本身。讓我告訴你,你應該怎麼做,在jQuery的

<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> 
 
<script> 
 
\t $(document).ready(function(){ 
 
    \t $("#form-to-be-submitted").click(function(){ 
 
     \t $(".whatever-styling-you-want").html($("#textBox").val()); 
 
     }); 
 
    }); 
 
\t 
 
</script> 
 

 
<div class="whatever-styling-you-want"> 
 

 
</div> 
 
<!-- Your text box and submit button --> 
 
<div> 
 
     <input type="text" id="textBox" placeholder="Please input your text here..."/> 
 
     <input id="form-to-be-submitted" value="submit" type="button"/> 
 
</div>

JavaScript的方式也相同。沒有必要使用點擊功能,但使用JavaScript的功能與'點擊'事件。 我希望這可以幫助。

-2
<!DOCTYPE HTML> 
<html> 
<head> 
<style> 

</style> 
</head> 
<body> 
<p id="x"></p><br> 
<input id="value"><input type="button" value="submit" onClick="getV()"> 
<script> 
function getV(){document.getElementById("x").innerHTML = document.getElementById("value").value;} 
</script> 
</html> 
+1

你想知道爲什麼你的答案被拒絕投票,那麼請在嘗試回答更多問題之前閱讀[如何寫出一個好答案?](http://stackoverflow.com/help/how-to-answer) 。 –

+2

我同意你需要閱讀我在評論中發佈的鏈接,它非常清楚地解釋了爲什麼這是一個低質量的答案。 –

+2

BLOB的代碼沒有解釋爲什麼它沒有一個好的答案,從來沒有,永遠不會。 –

相關問題