debbieau1
asked on
checkbox onclick show
I have a checkbox
<input name="mycheck" type="checkbox" value="1" id="mycheck" />
I want to call a hideinfo function (if it is not selected) or showinfo function (if checkbox value is selected). I need to call a function, not show a div as I am using this with canvas.
So it should be if checkbox is selected (has 1) then run showinfo()
if checkbox is not selected then run hideinfo()
<input name="mycheck" type="checkbox" value="1" id="mycheck" />
I want to call a hideinfo function (if it is not selected) or showinfo function (if checkbox value is selected). I need to call a function, not show a div as I am using this with canvas.
So it should be if checkbox is selected (has 1) then run showinfo()
if checkbox is not selected then run hideinfo()
if(document.getElementById('mycheck').checked=true) showinfo();
else hideinfo();
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
ASKER
Thanks heaps erdincgc
Very helpful.
I can use both solutions in what I am doing. Thanks again
Very helpful.
I can use both solutions in what I am doing. Thanks again
Open in new window