문제

what is Difference between "$$" and "$"?

$$('#items li').each( function(item) {
  item.observe('click', function(event) {
    doSomethingWith(event.target);
  });
});

==========================

$('items').observe('click', function(event) {
  if (event.target.tagName === 'LI') {
    doSomethingWith(event.target);
  }
});
도움이 되었습니까?

해결책

See the Prototype.js documentation

$ — id (String | Element) — A DOM node or a string that references a node's ID

$$(cssRule...) — Takes an arbitrary number of CSS selectors (strings) and returns a document-order array of extended DOM elements that match any of them.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top