2016-03-15 31 views
0

您好朋友,我是新開發其第一個項目,我想知道如何在運行時在div中顯示輸入字段數據,就像在stackoverflow問題部分中一樣,並建議我最好的框架,我只知道jQuery,這就是爲什麼我想在JQuery中開發這個。請幫幫我。想要在運行時在div上顯示輸入字段數據

<html> 
<body> 
    <input type="text" class="form-control" name="fname"> 

    <div>Want to show input text here on run time</div> 
</body> 

回答

0

嘗試這樣的:

<html> 
    <head> 
     <style>div{display:none;}</style> 
    </head> 
    <body> 
     <input type="text" class="form-control" name="fname"> 

     <div>Want to show input text here on run time</div> 
    </body> 
    <script> 
     // Put your event handler here on which you want to show this div 
     getElementsByTagName("div").css("display", "block"); 
    </script> 
</html> 
相關問題