I may be wrong here but don't you want to use the css reference so it should be $(this).css("border-style", "inset");
there is no html attribute called "border-style", to style a html tag you use the "style" attribute like <input type="text" style="border- style: inset"> On Aug 20, 3:44 am, Terry <tgs154...@yahoo.com> wrote: > I'm trying to "turn" the border for input fields on (or off). > > In my css I have border-style:none, and I want to turn the border back > on if the first input is empty. > > $("input[type='text']").each(function() { > $(this).attr("border-style", "inset"); > > }); > > The above code loops through the correct set of text input fields, but > the border is not "turned" back on? > > I've been using jquery for a couple of weeks and use javascript > infrequently, so jquery is very helpful in implementing my projects. > > Is the css overiding what I want to happen, or am I not using the attr > () method correctly? I've also tried the opposite in not having css > turn the border off, and use the attr() to turn it off, so it seem > like an attr() usage issue to me? > > Thanks, > > Terry