Kodenya adalah sebagai berikut:
/*
Deskripsi: Kontrol kotak centang
Versi: 1.1
Catatan: Teks yang mengikuti di balik kontrol kotak centang
Itu untuk mendapatkan htc_mylabel dari objek kotak centang untuk menampilkannya
Diperbarui dan menambahkan atribut indeter untuk meningkatkan pilihan yang tidak pasti
*/
<Publik: Komponen>
<public: attachEvent = "onContentReady" onevent = "fninit ()"/>
<public: attachEvent = "onpropertychange" onevent = "fnpropertychange ()"/>
<ScriptLanguage = "JavaScript">
varcheckboximg = window.document.createelement ("img");
ImageArray = [];
ImageArray ["centang kotak_false"] = "centang kotak_false.gif";
ImageArray ["centang kotak_false_down"] = "centang kotak_false_down.gif";
ImageArray ["centang kotak_false_over"] = "centang kotak_false_over.gif";
ImageArray ["centang kotak_true"] = "centang kotak_true.gif";
ImageArray ["centang kotak_true_down"] = "centang kotak_true_down.gif";
ImageArray ["centang kotak_true_over"] = "centang kotak_true_over.gif";
ImageArray ["centang kotak_indeter"] = "centang kotak_indeter.gif";
ImageArray ["centang kotak_indeter_down"] = "centang kotak_indeter_down.gif";
ImageArray ["centang kotak_indeter_over"] = "centang kotak_indeter_over.gif";
functionPreload (path, obj) {
untuk (iinobj) {
ini [i] = newImage ();
ini [i] .src = path+obj [i];
}
kembalikan ini;
}
preb = newpeload ("gambar/", imageArray);
functionFninit () {
varo = elemen;
if (o.type == "centang kotak") {
var_table = window.document.createelement ("tabel");
_table.cellspacing = "0px";
_table.cellpadding = "0px";
_table.border = "0px";
if (o.disabled) {
_table.style.filter = "alpha (opacity = 50)";
}
kalau tidak{
_table.style.filter = "";
}
_table.style.display = "inline";
var_tr = _table.InserTrow ();
var_td = _tr.insertCell ();
if (o. checked) {