Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的应用程序中使用jHtmlArea。我需要验证 textarea 值是否为空,因为我编写了一个函数,该函数将被称为提交按钮的onclick事件。
function x(){ alert($('#txtDefaultHtmlArea').val()); }
这里的警告框没有显示正确的值。每两次点击提交按钮后,它只显示实际文本,在此之前它显示前一个。所有这一切都只发生在 Firefox 中。它在铬中工作。
问题是什么?
这将更新文本区域
$("#nameoftextarea").htmlarea("updateTextArea");
所以你可以读出来
$("#nameoftextarea").val();