Javascript jQuery-在函数调用中使用当前对象

Javascript jQuery-在函数调用中使用当前对象,javascript,jquery,css,function,this,Javascript,Jquery,Css,Function,This,我想让这段代码正常工作,但是.css函数返回undefined $(".split-section-headings .ssh-cell") .html("This container has padding-top = " + $(this).css("paddingTop") ); 谢谢 如果没有类似于的东西,就不能使用$(this)。each()或在事件处理程序中: $(“.split section headers.ssh cell”).each(function(){ $(

我想让这段代码正常工作,但是.css函数返回
undefined

$(".split-section-headings .ssh-cell")
    .html("This container has padding-top = " + $(this).css("paddingTop") );
谢谢

如果没有类似于
的东西,就不能使用
$(this)
。each()
或在事件处理程序中:

$(“.split section headers.ssh cell”).each(function(){
$(this.html(“此容器具有padding top=“+$(this.css)(“padding”));
});


显示该语句周围的代码。这是在事件处理程序中吗?没有围绕它的代码。这是正文末尾的
标记中的唯一语句。在开始这个问题之前,我已经通过以下操作获得了预期的结果:
$(“.split section headers.ssh cell”).html(function(){return“this container has padding top=“+$(this).css(“paddingTop”)