开发者

How to change background color of a dialog input box using jQuery in IE 8?

开发者 https://www.devze.com 2023-03-21 23:08 出处:网络
I am having trouble doing this simple task of changing my input box color in a dialog created using jQueryUI in IE 8.

I am having trouble doing this simple task of changing my input box color in a dialog created using jQueryUI in IE 8. Take a look at the 2 demo here: http://jsbin.com/ofare/94/edit#source - not work开发者_JAVA技巧ing in IE http://jsfiddle.net/Cwm4W/10/ - working in IE but doesnt work in my dialog box

Both codes do not work when I run in my dialog box.

My code

<script>                 
     $('#test').css("background-color", 'gray');
     $( "#dialog-test" ).dialog({
                autoOpen: false,
                resizable: false,
                width: 350,
                height: 430,

                modal: true
     });
</script>

<div id="dialog-test">
<form>
    <table>
    <tr>
            <td>
                User Name
            </td>
            <td>
                <input type="text"  id="test" />      
            </td>
        </tr>
        </table>
</form>
</div>


dialog() is a JQueryUI function. Make sure you include it in your fiddle :)

This has a gray background in IE8, though my IETester doesn't really like it and alerts a couple unhelpful script errors: http://jsfiddle.net/AlienWebguy/Cwm4W/18/

$(function(){
     $("#dialog-test").dialog({
                autoOpen: true,
                resizable: false,
                width: 350,
                height: 430,
                modal: true
     }).find('#test').css('background-color','gray');
});
0

精彩评论

暂无评论...
验证码 换一张
取 消