距开课0天0时0分-10262845秒
红色熊猫2019-02-18 10:37:15 0 2 426
[jQuery讨论组]源自课程章节:jQuery事件方法(1)举报回复话题 ↕
<input type="text" name="" id="name">
<script type="text/javascript">
$(function(){
$('#name').change(function(){
console.log($(this))
$('this').css('backgroundColor','red');
})
</script>
为什么这样不行 > $(this)在控制台打印出来时 是获取到input的
1
0
分享
lh 2019-02-19 18:01:111楼
多了单引号
赞 +0添加回复
lh 2019-02-19 18:01:111楼
多了单引号
赞 +0添加回复