Skip to content

Refer to the current element

Dariel Noel edited this page Oct 1, 2014 · 8 revisions

The current element

####How refer to the current element?

Using the word: target like the next example:

"if click, on some li, do addClass hidden, to the clicked li"

<ul data-anijs="if: click, on: li, do: $addClass hidden, to: target" >
  <li>Hidden me</li>
  <li>Hidden me</li>
</ul>

Inside anijs sentence, you can refer to the element that triggered the event (A kind of "this" in respect of the event...) by using the word: target

Clone this wiki locally