Protection labs. The teacher asks you to show how to move the browser alert('sometext'); Can I interact with him and how? Lieb is not. Native js.

  • what does it mean to move? You can move the mouse :) - Grundy
  • move where? - Alexey Shimansky
  • Well, the teacher says to move to the upper left corner and ask him red color) 00) - Anque
  • one
    @Grundy What if I rewrite window.alert with my blackjack and ....? - Alexey Shimansky
  • one
    @Grundy and I think that’s what the teacher wanted. In any case, draw it as a solution and you can poke the teacher with his nose if he did not expect)) - Alexey Shimansky

2 answers 2

alert shows a blocking window, no access to its settings. Moreover, at the time of its display, the execution of other scripts is blocked. Thus, while it is open, nothing can be done.


As @ Alexey Shimansky suggests:

You can override the alert function, for example:

 window.alert = function(){ ... } 

And inside the function just show the absolutely positioned element.

  • thanks, and I will tell him: D - Anque
  • @Anhk, supplemented the answer a bit - Grundy

Mouse. Point at the heading, click and click.