单击或聚焦时如何向文本区域的父 div 添加一个类?
$(document).ready(function () {
$('textarea').toggleClass(function() {
if ($(this).parent().is('.expandingArea')) {
return $(this).parent().addClass('open');
} else {
return $(this).parent().removeClass('open');
}
});
});