javascript - If field empty set border to red -
after click on button set border around text field red.
name <input type="text" class="one" id="name"> <input type="button" value="ok" > i know style border
.one { border-style:solid; border-color:#0000ff; } i want set border red if field name empty after click on button. can make php or must use java script , event on click ??
you have use javascript that. should call javascript function upon click text box , add class when button clicked hence applying css when class added javascript. have in function check if text box empty add class else skip.
Comments
Post a Comment