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.I know this is an older post but I was looking for something similar this morning. I feel that my solution was much simpler after looking over some of the other solutions. One thing is that I use font awesome in the anchor tag.
I wanted to display an event on my calendar when the user clicked the event. So I coded a separate
<div>
tag like so:I find it easier to use class names in my jquery since I am using asp.net.
Below is the jquery for my fullcalendar app.
You must have your own google calendar id and api keys.
I hope this helps when you need a simple popup display.
I use SweetAlert, It's Awesome, You will get lots of customization option as well as all callbacks
I tried to use script for
alert()
boxes styles usingjava-script
.Here i used those JS and CSS.Refer this coding JS functionality.
And CSS for
alert()
BoxAnd HTML file:
And also View this DEMO: JSFIDDLE and DEMO RESULT IMAGE
Styling alert()-boxes ist not possible. You could use a javascript modal overlay instead.