changing textbox border colour using javascript

后端 未结 7 625
心在旅途
心在旅途 2020-12-30 02:20

I\'m doing form validation. when the form input is incorrect i add a red border to the textbox:

document.getElementById(\"fName\").style.borderColor=\"#FF000         


        
7条回答
  •  余生分开走
    2020-12-30 02:44

    You may try

    document.getElementById('name').style.borderColor='#e52213';
    document.getElementById('name').style.border='solid';
    

提交回复
热议问题