【发布时间】:2016-07-31 21:34:55
【问题描述】:
我正在搜索一个 javascript 或 html 或 css 代码,当我点击 textarea 时会更改背景颜色我需要类似 http://prntscr.com/bzsqgq
我尝试使用 javascript,但我无法做到这一点,我尝试使用 rgba 的 onclick 更改背景颜色,例如模糊。
$('.comment .body').on('click', function() {
if($(this).hasClass('changing')) {
$('.comment textarea').blur();
}else {
$('.comment textarea').focus();
}
});
$('.comment textarea').on('focus',function() {
$('.comment .body').addClass('changing').style('background-color: #FF0000;');
});
$('.change-stamp textarea').on('blur',function() {
$('.comment .body').removeClass('changing').text('background-color: transparent;');
});
谢谢谁能帮助我。
【问题讨论】:
-
没必要只用css
-
你评论表达你的意见..好的
标签: javascript html css