BruceyBandit
BruceyBandit

Reputation: 4324

Use css to not show the text box

I have text box and what happens is that the user will click on a button and a string will be generated and displayed in the text box. I need to use a text box as that I can use the "name" attribute for posting, but I do not really need the box, so what I really want to know is how in css can I not display the box? I won't be able to use hidden because then user won't be able to see the text.

Thank you

Upvotes: 0

Views: 2970

Answers (2)

Marcin
Marcin

Reputation: 1276

You can remove the border and make the background color of the textbox transparent (or to whatever color your page is).

#textBox
{
   border: none;
   background-color: transparent;
}

Upvotes: 3

mephisto123
mephisto123

Reputation: 1448

<input name="example" style="border: none;">

and if you want to use simple span instead of input box:

<span id="example"> </span>

and JS code to change its contents:

document.getElementById('example').innerHTML = 'test';

Upvotes: 0

Related Questions