Hi I have one textbox named txtName and I want to make it's style to bold and regular at runtime in onFoucs event.
I used this but no result...
document.Form1.txtName.style.font.bold=true;
Printable View
Hi I have one textbox named txtName and I want to make it's style to bold and regular at runtime in onFoucs event.
I used this but no result...
document.Form1.txtName.style.font.bold=true;
The element must have id="txtName" attribute for this to work.Code:var txtName = document.getElementById('txtName');
if(txtName) { txtName.style.fontWeight = 'bold'; }
For more details on CSS see W3C CSS property index; JavaScript uses the same names, except that properties with - character don't have it, instead the next character will be upper case. (ie. font-weight -> fontWeight).
Thanks u very much Merri..