<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <script type="text/javascript"> //<![CDATA[ function zdarzenie(event){ //alert(event.target.style.backgroundColor); if(event.target.style.backgroundColor=="rgb(255, 0, 0)"){event.target.style.backgroundColor='yellow'; document.getElementById("check"+event.target.id).checked=false } else{ document.getElementById("check"+event.target.id).checked=true event.target.style.backgroundColor='ff0000'; } } //]]> </script> </head> <body>
Dlaczego po dodaniu doctype do strony javascript przestaje działać ?
po usunieciu tej linijki:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
wszystko wraca do normy co robię źle ? jak transitional wpływa na javascript ?
Pozdrawiam