且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery的获得textarea的文本

更新时间:2023-11-14 17:42:16

为什么要转换击键为文本?补充一下,点击时发出的文字textarea的到服务器内的按钮。您可以使用value属性获取文本作为海报之前所指出的那样,或使用jQuery的API:

Why would you want to convert key strokes to text? Add a button that sends the text inside the textarea to the server when clicked. You can get the text using the value attribute as the poster before has pointed out, or using jQuery's API:

$('input#mybutton').click(function() {
    var text = $('textarea#mytextarea').val();
    //send to server and process response
});