简体   繁体   English

原型选择器

[英]Prototype Selectors

I have been trying to use Prototype to do some DOM manipulation, but I am not able to find much help on a certain selector. 我一直在尝试使用Prototype进行一些DOM操作,但是在某个选择器上找不到太多帮助。

I have a table with many rows and each of these rows has 4 columns, with each having a different class name. 我有一个表,其中有很多行,每行有4列,每列都有不同的类名。 Some of the cells might be empty, ie, they do not have a class, in a particular row. 有些单元格在特定行中可能为空,即它们没有类。

Now, when the user clicks on a cell in a particular row, I want the control to be transferred to the next cell of the same class, wherever that might be in the succeeding rows, if one exists. 现在,当用户单击特定行中的某个单元格时,我希望将控件转移到同一类的下一个单元格(如果存在的话,则可能位于后续行中的任何位置)。

Is it possible to do this using the Prototype library? 是否可以使用原型库执行此操作?

.next() 。下一个()

Lets you get the next sibling 让您获得下一个兄弟姐妹

To get the next row you'd do .up().next(); 要获得下一行,请执行.up()。next();。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM