user1937021
user1937021

Reputation: 10781

set value of element of an object jquery

I have an object in Jquery and I want to set the element page to 100 for example, how can I do that with jquery?

 var options = {
      valueNames: [ 'name', 'category' ],
      page: 3,
      plugins: [
          [ 'paging' ]
      ]
    };

Thanks.

Upvotes: 1

Views: 3048

Answers (2)

Dennis Martinez
Dennis Martinez

Reputation: 6512

You don't need jQuery to change the option property value.

options.page = 100;

http://jsfiddle.net/p6PNb/

Upvotes: 0

Rory McCrossan
Rory McCrossan

Reputation: 337560

No jQuery required as that is a POJS object. Assuming you mean that you want to change the page property after the object is created this will work:

var options = {
    valueNames: [ 'name', 'category' ],
    page: 3,
    plugins: [
        [ 'paging' ]
    ]
};

options.page = 100;

Upvotes: 2

Related Questions