作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在互联网上搜索过,甚至不确定 javascript 语言术语中的问题是什么。我想做的就是更改选定表行列内 div 元素的 css。另外,我希望在没有太多臃肿的情况下执行此操作,例如 .children() 因为我只想选择 div 子级而不是其他任何东西。本质上,我在 elmnt 中有一个存储的选定表行列,并且想遍历其中的每个 div 元素。这是代码
$(elmnt + " div").each(function (i){//also tried $(elmnt.div)... and $(elmnt +".div")...
if(this.style.cssFloat==="right")
this.style.cssFloat="none";
else
this.style.cssFloat="right";
});
我收到的错误是:
Error: Syntax error, unrecognized expression: [object HTMLTableCellElement].div @ ./resources/jquery-1.9.0.min.js:1567
感谢您的帮助
最佳答案
关于javascript - JQuery $(elmnt + "div").each 有办法做到这一点吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18389934/
我是一名优秀的程序员,十分优秀!