2012-01-03 39 views

回答

0

这是未经测试的,但你可以做的是添加一些代码到模态的点击功能来抓取textarea的文本,然后传递给模态本身。这将是这样的,假设你有一个名为myTextArea textarea的:

$('a[name=modal]').click(function(e) { 
    //Cancel the link behavior 
    e.preventDefault(); 

    //This is the added part: 
    //Get the textarea's text 
    var taText = $('textarea#myTextArea').val(); 

    //Example - Now add the text to a span tag inside the modal 
    ("#myDiv span").text(taText); 

    ... 

这应该有希望做到这一点。