Can I refer to the object within jQuery chain using this keyword? -
Let me say that It does not seem that Yes, but you have to use an anonymous function : & lt; P & gt; A numeric character should be increased in the tag. Is it possible to use something like this down?
$ ('p'). Text (parse int ("this") + 1);
this refers to the same object when I do the example below:
$ ('P') Text ($ (this) .height ()). // print $ 731 ('P'). Text ($ (this) .text ()); // Change to empty
$ ('p'). Text is the index of element (i, t) {// i element of the collection, // if there is an element then // is text. Assuming that the first text-letter is a valid number: return parasont (t, 10) + 1;});
Comments
Post a Comment