Can I refer to the object within jQuery chain using this keyword? -


Let me say that & 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);   

It does not seem that 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    

Yes, but you have to use an anonymous function :

  $ ('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

Popular posts from this blog

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -