Get dynamic value to input type"text"

565 Views Asked by At

I am trying to customize TurnJS with some special effects. I need to show current page number while flip each page into a <input type="text" id="pageNumber" value=""> field.

The value should get with this function (added alert for test):

$("#flipbook").bind("turned", function(event, page, view) {
  alert("Page: "+$("#flipbook").turn("view")[0] +$("#flipbook").turn("view")[1] );
});

How can I get this value to the <input> field?

Can I use this: Get the value in an input text box ?

1

There are 1 best solutions below

0
Ruben Pauwels On

You can use the jQuery .val() method to fill the input-tag.

$("#flipbook").bind("turned", function(event, page, view) {
  $('#pageNumber').val(page);
});

See jQuery .val()