Laurence L
Laurence L

Reputation: 623

Clear input value in form

Due to IE8 transparancy issue I want to remove the value from a form field.

<input type="button" value="Something" />

I tried several variations of

$(' input[type="submit"], input[type="inputSubmit"], input[type="button"]').val('');

With no success. I know this should be simple.

I'd appreciate any help with this.

Thanks

Upvotes: 2

Views: 1945

Answers (2)

Sinetheta
Sinetheta

Reputation: 9449

Are you sure? This is working fine for me all the way back to IE7

$('input[type="button"]').val('');

The result is a button with no text.

Upvotes: 2

fivedigit
fivedigit

Reputation: 18702

You're looking for:

$('input[type=text]')

Make sure the input's type is explicitly set to text, or it might fail.

Upvotes: 0

Related Questions