对于textarea标签的使用

在jQuery中,textarea标签的的用法是:<textarea  id=""  name="">要输入的文本</textarea>,如果要把PHP传过来的数据在标签显示需要用到HTML方法。

 

 

           <textarea id="txt1" name="Text" cols=40 rows=8>
              
              
              </textarea>
            
              <center><input type="button" id="button1" value="查询" /></center>
               
              <script>

                $("#button1").click(function(){
                
                  $.post("baojing.php",function(result){
                  
                   $("#txt1").html(result);  //通过AJAX 把php数据回调到前端,再通过html方法使其显示在标签中。
                    
                  
                  });
            
                })
                
              </script>

posted @ 2016-05-18 08:41  逆流的致爷  阅读(523)  评论(0编辑  收藏  举报