coding180 icon
Coding180
JavaScript interactive methods exercises

JavaScript interactive methods exercises

Home > Tutorials > JavaScript > Common Interaction Methods


Make a new button, "Open website in new window", click to open a new window.

Task

1. When a new window is opened, a confirmation box pops up, whether to open it

Tip: Use if to check whether the confirmation box is clicked, if clicked, the input dialog box pops up, otherwise there is no operation.

2. Through the input dialog box, determine the opened URL, the default is http://www.coding180.com/

3. The opened window requires a width of 400 pixels and a height of 500 pixels, with no menu bar and no toolbar.

Task code

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>close()</title>
  <script type="text/javascript">
     var mywin=window.open("http://www.coding180.com");
 
  </script>
</head>
<body>
</body>
</html>

 


user

Robort Gabriel

Lagos, Nigeria

Freelance Web Developer, Native Android Developer, and Coding Tutor.

Skills
  • UI / UX
  • JavaScript
  • Python
  • PHP
  • Kotlin
  • Java
  • Bootrap
  • Android
  • Laravel