$(document).ready(function(){
veri();
});
function veri(){
//fechas reservadas
var ar = ["09lun","10lun","093mar","10mie"];
//iniciamos un contador
var con = 0;
//recorremos la tabla
$('#tabla tr').find('td').each(function (i, v) {
//asignamos a una variable la id de cada td de la tabla
var ref = ($('#tabla tr').find('td')[con].id);
//verificamos si esa id esta en el array
if( $.inArray(ref,ar) > -1 ){
//Si lo esta, le asignamos una clase
$("td[id="+ref+"]").addClass('danger');
$("td[id="+ref+"]").html("<i class='fa fa-check-square'></i> Reservado");
}
//incrementamos el contador
con = parseInt(con)+1;
});
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.