Reputation: 20882
I have the following code and it works fine in all browsers:
<input type="text" id="fileUploadTextBox" value="Browse My Computer"/>
When it comes to IE I wanted to change the text slightly to
<input type="text" id="fileUploadTextBox" value="Browse My Computer (Double Click)"/>
Can I do this using CSS? I know how to run a separate CSS file for IE.
Or is there another way to do this?
thx
Upvotes: 0
Views: 97
Reputation: 9469
By using conditional comments you can do this:
For Other Browsers:
<!--[if !IE]><!-->
<input type="text" id="fileUploadTextBox" value="Browse My Computer"/>
<!--<![endif]-->
For IE Browsers:
<!--[if IE]>
<input type="text" id="fileUploadTextBox" value="Browse My Computer (Double Click)"/>
<![endif]-->
Or you can use Javascript/jQuery to achieve it.
Upvotes: 4
Reputation: 5367
This Javascript with jQuery should work:
if ( $.browser.msie ) {
<input type="text" id="fileUploadTextBox" value="Browse My Computer (Double Click)"/>
} else {
<input type="text" id="fileUploadTextBox" value="Browse My Computer"/>
}
Upvotes: -1