phpSensei Posted March 1, 2008 Share Posted March 1, 2008 Is there anyway to access a textfields "class=" and change it with Javascript? I tried document.emailForm.name.class = 'red_border'; doesnt work. Quote Link to comment Share on other sites More sharing options...
fenway Posted March 1, 2008 Share Posted March 1, 2008 I believe it's via className. Quote Link to comment Share on other sites More sharing options...
haku Posted March 1, 2008 Share Posted March 1, 2008 for firefox (and I believe safari and opera), you use this: document.emailForm.name.setAttribute= ("class", "'red_border"); and for IE you use this: document.emailForm.name.className = 'red_border'; Quote Link to comment Share on other sites More sharing options...
phpSensei Posted March 1, 2008 Author Share Posted March 1, 2008 Thanks guys, the className worked perfect. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.