Home javascript How to remove iframe from JS code inside the frame

How to remove iframe from JS code inside the frame

Author

Date

Category

I have iframe :

& lt; iframe src = "include_modal / index.html" id = "qwiz" allowTransparency = "True" & gt;

inside it is there is an event “close”, I want to do something like that of the IFrame’a itself:

$ (". close"). Click (function () {
  $ ('# QWIZ'). CSS ('OPACITY', '0');
});

Answer 1

If you just want to make your iframe invisible by clicking on the button:

$ (". Close-Button"). ON ("Click", function () {
  $ ("# QWIZ"). CSS ("OPACITY", "0")
})

What to “close” block:

// Replace $ ("# QWIZ"). CSS ("Opacity", "0") on
$ ("# QWIZ"). Hide ()

To delete a block from DOM:

// Replace $ ("# QWIZ"). CSS ("Opacity", "0") on
$ ("# QWIZ"). Remove ()

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions