Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- function sig(){
- var array = new Array(" Disponible ", " Ocupado ", " Mantenimiento ",);
- for(i=0; i < array.length; i++){
- if(document.getElementById('Fmbtn').value == array[i]){
- var indice = (i + 1 == array.length) ? 0 : i + 1;
- document.getElementById('Fmbtn').value = array[indice];
- localStorage.setItem("estado", array[indice]);
- break;
- }
- }
- }
- window.onload=function()
- {
- if(localStorage.getItem("estado")!=null)
- {
- estado =localStorage.getItem("estado");
- document.getElementById('Fmbtn').value = estado;
- }
- }
- <div class="row" style="text-align:center">
- <div class="span2">
- <div class="well well-small">
- <h4>Habitación 1
- </h4>
- <input id="Fmbtn" type="button" value=" Disponible " onclick="sig()" />
- <a href="habitacion1.php"><small>Ver detalles</small></a>
- </div>
- </div>
Add Comment
Please, Sign In to add comment