我有一段在文档就绪时的 jQuery 代码,用于切换包含一个 textarea
的 div:
$('div#addnote-area').hide(); // hide the div
$('a#addnote-link').click(function() { // click event listener on link
$('div#addnote-area').toggle(); // toggle the hidden div
});
单击链接时,切换工作正常。 我遇到的问题是,如果
$('body,html')
。 - Ben