Forum : alert msg box
Brief description  about Online courses   join in Online courses
View Sri Bhargavi  Peesapati 's Profile

alert msg box

<HTML>
<HEAD>
<TITLE>Tilte of the web page</TITLE>
<SCRIPT language="javascript">
alert(document.title);
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>

In the above example, we get a pop-up box indicating the title of that webpage...

If I want background color to be changed with that pop-up box, I replaced code with alert(document.bgColor="red"); but I am not getting any change in the background color. Why so?
Is it that we should mention such property only in OnClick code?? Can't we give it in alert box directly?
Asked by Sri Bhargavi Peesapati | Jul 8, 2010 |  Reply now
Replies (2)
View sri-bhargavi peesapati 's Profile
Oh .. ok Thank You
Jul 14, 2010
View teacher siliconindia 's Profile
Hi Bhargavi ,

You cant change background color with alert box.
Jul 14, 2010