Liza Daly's example (linked by charleski above) is a great place to start.
Two important things to note:
- Inline scripts do not work in iBooks. You must write your script in a separate file and embed it using
Code:
<script type="text/javascript" src="script.js"></script>
- Scripts aren't allowed to access remote files.
Also, I think I recall that you're limited to embedding ONE javascript file in your html. But I could be wrong about that.