When i click on the right arrow the next element of the array should be displayed in the input area?
$(function(){
var room = ['1-visiting office', '2-', '3-'];
$('#text_holder').val(room[0]);
$("#rightarrow").click(function(){
$('#text_holder').val(room[next]);
});
});
This is my html code
<input id="text_holder" name="text_holder"/>
<img src="dev/images/rightarrow.jpg" id="rightarrow" />
I like Rocket’s answer more than mine. But here’s 1 more way if you find it useful.