Internet Explorer İşaret kutularının(checkbox) onchange tetiklemesindeki sorun ve çözüm önerisi

Aslında konuyu başlıkta anlattım. İşaret kutularına onchange ekleyip tetiklemeye çalışınca çalışmıyor. Firefox’da çalışıyor sorunun çözümü

<p>
    <input type="checkbox" onchange="document.getElementById('spDegistir').innerHTML = 'Checked: ' + this.checked;" id="change">
    <label for="change">Using onchange</label>
    <span id="spDegistir"></span>
</p>

Bu kod Internet Explorer’da çalışmayacaktır. Bizde bunun yerine onclick tetiklemesini kullanacağız.

<p>
    <input type="checkbox" onclick="document.getElementById('spDegistir').innerHTML = 'Checked: ' + this.checked;" id="change">
    <label for="change">Using <code>onchange</code></label>
    <span id="spDegistir"></span>
</p>

kaynak: http://krijnhoetmer.nl/stuff/javascript/checkbox-onchange/

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

6 Yorum (Yorum Ekle)

Yorum yaz

Format: Yorum içinde kullanılabilecek HTML kodları: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

?