Change Font

  • Thread starter Thread starter David Dvali
  • Start date Start date
D

David Dvali

Hello.

I have one TextBox and one CheckBox on my web page, now when I click on the
CheckBox I want to change font (depends on CheckBox state) of my TextBox
wuth JavaScript.
How can I do this?

Thank you.
 
Make Css classes and handle the checkbox's onclick event:

<asp:checkbox ... onclick="clicked(this)" ... />

Javascript:

function clicked(chBox){
if (chBox.checked)
myForm.txtBox.className="CssForChecked";
else
myForm.txtBox.className="CssForUnChecked";
}

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top