DOM practice

Cancels the default behavior for hyperlinks to jump to pages

  • When a hyperlink is clicked, it redirects to the page. This is the default behavior of the hyperlink, but we do not want the default behavior at this time. We can cancel the default behavior by returning false at the end of the response function
  • Or set the href = “javascript:;” in the hyperlink

confirm

  • Confirm () is used to bring up a prompt box with confirm and cancel buttons
  • You need a string as an argument that will be displayed as a prompt
  • Alert only pops up a prompt box with a confirmation button
  • confirm(“”);

  • The user clicks Ok to return true, and cancels to return false

Want to display the deleted character name in the prompt box

  • What I did:

Trouble and silly

Teacher practices:

High-end!!!!!!

special

In this code, the for loop is loaded three times when the page loads and then the response function is executed when the hyperlink is clicked

So we can’t replace “this” with “allA” [I] they’re not equal