如何改变警报框的样式 [英] how to change the style of alert box

查看:126
本文介绍了如何改变警报框的样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在警告框中更改确定按钮的样式。



 < head> < script type =text / javascript> function show_alert(){alert(Hello!I am a alert box!); }< / script>< / head>< body> < input type =buttononclick =show_alert()value =Show alert box/>< / body>  

div>

解决方案

警告框是一个系统对象,不受CSS限制。要做这种风格的事情,你需要创建一个HTML元素并模仿 alert()功能。 jQuery UI模块框为你做了很多工作,基本上如我所述:链接


I need to change the style of the "OK" Button in an alert box.

<head>
    <script type="text/javascript">
        function show_alert() {
            alert("Hello! I am an alert box!");
        }
    </script>
</head>
<body>
    <input type="button" onclick="show_alert()" value="Show alert box" />
</body>

解决方案

The alert box is a system object, and not subject to CSS. To do this style of thing you would need to create an HTML element and mimic the alert() functionality. The jQuery UI Modal box does a lot of the work for you, working basically as I have described: Link.

这篇关于如何改变警报框的样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆