Problema cod javascript in input adaugat cu ajax
Scris: Lun Noi 23, 2015
Salut,
am urmatoarea instructiune in HTML cu JS care functioneaza corect (simplificat):
daca aceeasi instructiune o pun in PHP (simplificat, intr-un fisier apelat cu ajax):
nu mai functioneaza corect (nu se coloreaza checkbox-ul). Am mai intilnit astfel de situatii. Care este cauza? Multumesc.
am urmatoarea instructiune in HTML cu JS care functioneaza corect (simplificat):
Cod: Selectaţi tot
<th><input type="checkbox" id="cec'" onchange="if (this.checked) {this.parentNode.style.background="#ef4d35"; } else {this.parentNode.style.background="white";}" /></th>
Cod: Selectaţi tot
<?php
$re_html .='<th><input type="checkbox" id="cec" onchange="if (this.checked) {this.parentNode.style.background="#ef4d35"; } else {this.parentNode.style.background="white";}" /></th>';
...........
echo $re_html;
?>