+ 1
How should I remove the border styles added to a textbox(<input type="text">) to make it default textbox
How JavaScript makes textbox to default after adding border styles to textbox
4 Answers
+ 3
Charm We are unable to give a proper answer to your question in its current state. Please add more details as Ipang suggested.
If you meant the outline when the input gets focused(I'm making a big guess here) :
HTMLâ
<input id=txt />
Cssâ
#txt:focus {
outline: none;
}
+ 2
What is a default textbox? isn't 'text' the default value for <input> "type" attribute?
And what's the need for JS when you can set the preference through CSS?
Maybe you can add more description 'cause I feel like a bit lost (didn't really understand you).
+ 1
If i add border styles to the textbox .How do I remove all border styles added to textbox using JavaScript (i.e on clicking a button)
The textbox what I mean is ,the textbox(input box)generated on using the below html code
<input type="text">
+ 1
Try to set the '<element>.style.borderStyle' to "none" ...
For example, assuming the texbox's ID attribute was "text_box";
* HTML
<input type="text" id="text_box" />
* CSS
#text_box {
border: thin solid blue;
}
*JS (button click event handler)
document.querySelector("#text_box").style.borderStyle = "none";