Hi there,
every few month I need a little javascript, and every time I get into problems :/
I hope you can explain this to me:
I want to write a small functions which set some elements visible / invisible, dependent if the related checkbox is checked or not.
Should be very simple, but sadly not for me.
The ideea:
function test()
{
if (document.getElementById('zuteiler').checked = true)
{
// set the elements visible
}
// hide the elements
}
But this doesnt work. With this function I event can't uncheck my checkbox even more...
It seems to me that javascript makes out of the comparison "if (document.getElementById('zuteiler').checked = true)" a command and set allways the chechbox to checked ??!
I hope you can help me once more,
thx a lot,
greets ben
every few month I need a little javascript, and every time I get into problems :/
I hope you can explain this to me:
I want to write a small functions which set some elements visible / invisible, dependent if the related checkbox is checked or not.
Should be very simple, but sadly not for me.
The ideea:
function test()
{
if (document.getElementById('zuteiler').checked = true)
{
// set the elements visible
}
// hide the elements
}
But this doesnt work. With this function I event can't uncheck my checkbox even more...
It seems to me that javascript makes out of the comparison "if (document.getElementById('zuteiler').checked = true)" a command and set allways the chechbox to checked ??!
I hope you can help me once more,
thx a lot,
greets ben