Posts

Showing posts from February, 2015

Program To Make the button to demonstrate the prompt box Using JavaScript in HTML

Image
Program To Make the button to demonstrate the prompt box Using JavaScript in HTML This program will show a button in your browser window and when you click on that button, then a prompt box will popup-ed. In that, you will write your name in text box, then click ok and your message or name display in your browser page. <html> <body> <p>Click the button to demonstrate the prompt box.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var x; var person=prompt("Please enter your name","Harry Potter"); if (person!=null)   {   x="Hello " + person + "! How are you today?";   document.getElementById("demo").innerHTML=x;   } } </script> </body> </html> Thank you for visiting :D :D 

A JavaScript Program To Move New Window To Specified Position Using HTML

Image
A JavaScript Program To Move New Window To Specified Position Using HTML <html> <head> <script> function openWin() { myWindow=window.open('','','width=200,height=100'); myWindow.document.write("<p>This is 'myWindow'</p>"); } function moveWin() { myWindow.moveTo(300,0); myWindow.focus(); } </script> </head> <body> <input type =" button " value =" Open 'myWindow' " onclick =" openWin() " /> <br> <br> <input type =" button " value =" Move 'myWindow' " onclick =" moveWin() " /> </body> </html> OutPut Of This Program::::